https://github.com/sinclairzx81/brainfuck-rs
A brainfuck interpreter implemented in Rust.
https://github.com/sinclairzx81/brainfuck-rs
brainfuck interpreter rust
Last synced: 18 days ago
JSON representation
A brainfuck interpreter implemented in Rust.
- Host: GitHub
- URL: https://github.com/sinclairzx81/brainfuck-rs
- Owner: sinclairzx81
- License: other
- Created: 2016-07-28T10:52:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-28T17:03:06.000Z (almost 10 years ago)
- Last Synced: 2025-06-27T06:52:04.234Z (about 1 year ago)
- Topics: brainfuck, interpreter, rust
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# brainfuck-rs
a brainfuck interpreter in rust.
```rust
use brainfuck::Program;
fn main() {
let mut program = Program::create("
++++++++[>++++[>++>+++>+++>+<<<<-]
>+>+>->>+[<]<-]>>.>---.+++++++..++
+.>>.<-.<.+++.------.--------.>>+.>
++.
").unwrap();
program.stdin (Box::new (|| 0u8 ));
program.stdout (Box::new(|b| print!("{}", b as char)));
program.run().unwrap();
}
```
## overview
brainfuck-rs is a small interpreter for the brainfuck programming language written in Rust. This project was written to
experiment with hosting a small vm inside of Rust and to explore various threading and io related concepts. This project
was also written for fun.
information on the brainfuck language can be found at [https://en.wikipedia.org/wiki/Brainfuck](https://en.wikipedia.org/wiki/Brainfuck)
This project offered as is for anyone who finds it useful or interesting.
## running examples
```
cargo run --example helloworld
cargo run --example fibonacci
cargo run --example mandelbrot
```