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.1.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.1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rubus_b1-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7dec63d5cdf1e831207e4432a45b2b5891178cf2900bf3c90a861c8e68831b49
MD5 697c2a6d8b6458879b8fde171252b6e3
BLAKE2b-256 2a7cd78bda0e31da60c9f4a2d8df15a412a2928ff9aacd2f55ece00e4c4625d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rubus_b1-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6a7b0e89983c83b67a9e61e8e2f5b2f2a226dfc44f256a0ca52af0078b04e89
MD5 ed213b3e9c3c363f87584e84dd49b22b
BLAKE2b-256 b3029ddb5e2ac35fce958ba2f773c94bd9aa0d2366ab85ae926296f303079d03

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