| Crates.io | bfrunner |
| lib.rs | bfrunner |
| version | 0.1.2 |
| created_at | 2026-01-21 00:47:11.660694+00 |
| updated_at | 2026-01-21 01:39:43.965063+00 |
| description | A Brainfuck interpreter in Rust, for shits and giggles. Not for production. |
| homepage | |
| repository | https://github.com/NekoTheCatgirl/bfrunner |
| max_upload_size | |
| id | 2057917 |
| size | 14,041 |
A Brainfuck interpreter for shits and giggles. Seriously. Don’t use this in production.
bfrunner is a tiny, pure-Rust Brainfuck interpreter. It's fast enough to play with small programs, safe enough that it won't melt your computer (probably), and it comes with optional FFI support if you want to torture another language with this as well!
Add this to your Cargo.toml
[dependencies]
bfrunner = "0.1.0"
use std::io::Cursor;
use bfrunner::{ BrainfuckError, run_to_string };
const SOURCE: &str = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";
fn main() -> Result<(), BrainfuckError> {
let mut input = Cursor::new(Vec::<u8>::new());
let output = run_to_string(SOURCE, &mut input)?;
println!("{output}");
Ok(())
}
use std::io::Cursor;
use bfrunner::{ BrainfuckError, run_to_string };
const SOURCE: &str = ",[.,]";
fn main() -> Result<(), BrainfuckError> {
let mut input = Cursor::new(b"Hello, world!".to_vec());
let output = run_to_string(SOURCE, &mut input)?;
println!("{output}");
Ok(())
}
bfrunner distinguishes between:
If you build the library from source with the ffi feature enabled, you can run Brainfuck code from C using:
int Brainfuck_run(const char*, const char*, char*, size_t);
Check the function in ffi.rs for error codes.
This crate exists purely for fun, learning, and mild frustration. Brainfuck is notoriously impractical, and so is this interpreter. Do not expect it to replace any serious programming language or runtime.
Use at your own risk. May cause laughter, confusion, or existential dread.
PRs, bug reports, and memes are welcome. Keep it silly, keep it safe.