Yet Another Brainfuck Interpreter in Rust
Latest commit 6b078a6 Aug 10, 2016 @s3rvac Fix the repository path in Cargo.toml.
There was a copy&paste error.
Failed to load latest commit information.
programs Add a new program: Aug 6, 2016
Cargo.lock Initial commit. Jul 31, 2016
Cargo.toml Fix the repository path in Cargo.toml. Aug 10, 2016
LICENSE-MIT Remove the mention of the used Rust version from README. Aug 7, 2016

Yet Another Brainfuck Interpreter in Rust

Build Status

Lately I have been learning Rust. As my first project, I decided to write a Brainfuck interpreter. Feel free to submit issues or pull requests on how may I improve the code!

Building and Running

  • Ensure that you have a Rust installed, including cargo (Rust's build and package manager).
  • Clone the repository:
$ git clone
  • Build the interpreter:
$ cargo build --release
  • Run it on a Brainfuck program:
$ target/release/yabir PROG

The programs directory contains a few sample programs you can try.

Implementation Notes

As stated here, there are some portability issues that developers of Brainfuck interpreters and programs need to be aware of. My implementation behaves as follows:

  • Cells are 8-bit unsigned integers. They wrap around (e.g. when incrementing 255, you get 0).
  • The data array has potentially unlimited size and is automatically resized. However, the array can be extended only to the right.
  • Emitted ends of lines are platform-specific (e.g. LF on Linux).
  • The behavior of the , command (read a byte from the input stream) when an end-of-file condition has been encountered is to leave the current cell unchanged.


Licensed under either of

at your option.