A BF interpreter written in Rust, simple, fast, and usable as a system command.
- Full Brainfuck language support (
><+-.,[]) - Automatically ignores spaces, tabs, newlines, and comments
- Executable via the
brainfuckcommand - Clean architecture: tokenizer β parser β virtual machine
- Rust installed (https://rustup.rs)
Check with:
rustc --version
cargo --versiongit clone https://github.com/Clesiaaa/BF-Interpreter
cd BF-Interpreter
cargo build --releaseThen copy the compiled binary to your Cargo bin directory:
cp target/release/bf ~/.cargo/bin/Make sure ~/.cargo/bin is in your $PATH.
cargo run program.bfbf program.bfecho ">++++[<++++++++>-]<+." > hello.bf
bf hello.bfsrc/
βββ main.rs # Entry point, CLI handling
βββ tokenizer.rs # Brainfuck filtering and tokenization
βββ parser.rs # Program construction
βββ virtual_machine.rs # Program execution
cargo build --releaseGenerated binary:
target/release/bf
Run directly:
./target/release/bf program.bfBrainfuck is a minimalist esoteric programming language made of only 8 instructions:
| Instruction | Description |
|---|---|
> |
Move the pointer to the right |
< |
Move the pointer to the left |
+ |
Increment the current cell |
- |
Decrement the current cell |
. |
Output the current cell as a character |
, |
Read one character of input |
[ |
Start loop |
] |
End loop |
All other characters are ignored.
- Debug mode (
--debug) - Step-by-step execution
- Configurable memory size
- Input file support
Free project β do whatever you want π
Developed by ROBERT FOLGA