Skip to main content

A tree-walking interpreter and terminal-based editor for the Rubus language.

Project description

Rubus

A tree-walking interpreter for the Rubus programming language, bundled with rubed — a lightweight, terminal-based text editor built specifically for writing and running .rub files.

Overview

The Rubus ecosystem consists of a Python-like, indentation-based programming language and a dedicated command-line environment. The interpreter processes raw source code through a lexer and parser to build an Abstract Syntax Tree (AST), which is then directly executed without an intermediate compilation step or bytecode generation.

Installation

pip install rubus-b1

On Linux/macOS, no extra dependencies are needed. On Windows, windows-curses is installed automatically.

After installing, the rubed command is available globally:

rubed                          # open the editor with an empty buffer
rubed path/to/script.rub       # open a file in the editor
rubed path/to/script.rub --run # run a script headlessly

Features

The Rubus Language

  • Control flow: if / elif / else, for, while
  • Types: integers, floats, booleans, strings, and f-strings
  • Built-in collections: lists, dictionaries, sets, and tuples
  • List and dictionary comprehensions
  • Custom struct definitions
  • Function definitions (def) and variable declarations (let)
  • Lexical scoping and environment management
  • Try / except / finally error handling
  • Tuple unpacking: a, b = 1, 2
  • Default parameters and keyword arguments

The Rubus Editor (rubed)

  • Terminal-native: built with curses for a seamless command-line workflow
  • Syntax highlighting: real-time colorization for keywords, types, strings, numbers, comments, and operators
  • Integrated execution: run .rub scripts directly from within the editor

Keybindings

Key Action
Ctrl+S Save file
Ctrl+R Run the current file
Ctrl+N New buffer
Ctrl+O Open an existing file
Ctrl+Q Quit (prompts if unsaved)

Usage

# Open editor with empty buffer
rubed

# Open a specific file
rubed path/to/script.rub

# Run a script without opening the editor
rubed path/to/script.rub --run

Example

def greet(name: str) -> str:
    return f"Hello, {name}!"

let names: list = ["Alice", "Bob", "Carol"]
for n in names:
    print(greet(n))

Requirements

  • Python 3.10+
  • windows-curses (Windows only, installed automatically)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rubus_b1-0.1.2.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rubus_b1-0.1.2-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file rubus_b1-0.1.2.tar.gz.

File metadata

  • Download URL: rubus_b1-0.1.2.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rubus_b1-0.1.2.tar.gz
Algorithm Hash digest
SHA256 441ea920f0c54d941f12a62bc03b6f9fe6327c5610d7ac61241c0b5b74879de2
MD5 b2ea42ccd5dfee7198c98a0e2f1dd509
BLAKE2b-256 6b2bdce41e7c410763055b9e876f8e8e9d108cebb3c07007f7701030af373b68

See more details on using hashes here.

File details

Details for the file rubus_b1-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rubus_b1-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rubus_b1-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40e4819ac2601b31e86f1c538f989c1fe29cd7ce632d5069a0dfe7192e81e91b
MD5 d6435957aa46e030b59d031d6602728f
BLAKE2b-256 c5913c5526952d0577463911f441875e53e67f01fddec737793c150281683da0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page