tachyon#
a brainfuck interpreter written in rust.
warning#
my first rust project and my first interpreter. bad code everywhere. you have been warned!
features#
- standard 30,000 byte tape with configurable length.
- data pointer out-of-bounds behavior:
error(crash on bounds violation, default) orwrap(wrap around). - cell value out-of-bounds behavior:
wrap(wrapping 8-bit, default) orerror(crash on overflow/underflow). - ascii i/o (default) and raw 8-bit numeric i/o for input and output.
- syntax diagnostics: catches unmatched brackets before execution.
- unit tests covering instructions, loops, nesting, out-of-bounds behaviors, and i/o modes.
building#
cargo build --release
usage#
./target/release/tachyon [OPTIONS] <PATH>
options#
| flag | description | values |
|---|---|---|
-d, --data-oob |
data pointer out-of-bounds behavior | error (default), wrap |
-c, --cell-oob |
cell value out-of-bounds behavior | wrap (default), error |
-l, --length |
custom tape length | number (default: 30000) |
-i, --input-type |
input mode | ascii (default), raw |
-o, --output-type |
output mode | ascii (default), raw |
run a brainfuck script:
./target/release/tachyon path/to/your/script.bf
use wrapping data pointer and raw i/o:
./target/release/tachyon -d wrap -i raw -o raw script.bf
set a custom tape size of 100 cells:
./target/release/tachyon -l 100 script.bf
crash on cell overflow instead of wrapping:
./target/release/tachyon -c error script.bf