fBASIC (Floor Basic) is a deliberately minimal—and delightfully annoying—bytecode language and VM, written in Rust, with companion Python tools to compile and package your .fb scripts into raw bytecode (.fbin) or metadata‑wrapped packages (.fbp). But the compiler and packager are closed-source, for your inconvenience. The language features:
- A global operand register via
SETVALUE - Simple drawing via
PX - Console logging via
PRINT - Absolute jumps via
GOTO - Text-based console inpit via
INPUT - Currently-stored value appending via
APPEND_VALUE - Clearing the currently-stored value via
CLEAR_VALUE - Adding to currently-stored value as number via
ADD - Subtracting from currently-stored value as number via
SUB - New-line character writing via
NL - Console-clearing via
CLS - Sleeping/waiting as milliseconds via
WAIT - Extensible opcode map (up to
0xFF) - Two formats:
- Raw
.fbinfiles (opcodes + data markers) - Packaged
.fbpfiles (with metadata header)
- Raw
- Operating System (linux and Windows are fully tested)
- Terminal
- Rust toolchain (nightly recommended)
cd rust-fbasic
cargo build --releaseThis produces the interpreter binary at
target/release/fbasic.exe # on Windows
target/release/fbasic # on Unix
./target/release/fbasic path/to/program.fbin./target/release/fbasic path/to/program.fbpThe VM auto‑detects by looking for 0x00 as the first byte (metadata marker).
We do have our own closed-source compiler and packager, but that's no fun.
python3 compiler.pyReads ./program.fb → writes ./program.fbin.
python3 packager.pyReads ./program.fbin → writes ./program.fbp.
Edit the metadata (package name, description) inside the program.package.env as needed.
.
├── LICENSE # MIT License
├── README.md # This file
├── Cargo.toml # Cargo project metadata
└── src/ # Source code root
├── main.rs
└── executor/
├── mod.rs
└── commands.rs
- Fork the repository and create your feature branch:
git checkout -b feature/AnnoyingNewOpcode
- Commit your changes:
git commit -am "Add DELAY opcode (0x05)" - Push to your fork and open a Pull Request.
- Make sure your code passes existing tests (if any), and update
README.mdif you add new commands or change formats.
This project is released under the MIT License. Feel free to use, modify, or spite your fellow developers!