Skip to content
/ yabir Public

Yet Another Brainfuck Interpreter in Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

s3rvac/yabir

Repository files navigation

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 https://github.com/s3rvac/yabir
  • 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.

License

Licensed under either of

at your option.

About

Yet Another Brainfuck Interpreter in Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages