breakfast 0.1.4

A Brainfuck interpreter in Rust
Documentation
  • Coverage
  • 76.92%
    10 out of 13 items documented1 out of 7 items with examples
  • Size
  • Source code size: 7.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.68 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • xngwei

The Breakfast Brainfuck Interpreter

Breakfast is a minimal brainfuck (BF for short) interpreter in Rust.

It offers most of the suggested BF features, including multiple EOF behaviors and # for debug purposes.

Example

Here is a simple piece of code to run the “Hello World” BF program:

use breakfast::*;

fn main() -> std::io::Result<()> {
    let program = Breakfast::parse(
        r#"
            >++++++++[<+++++++++>-]<.
            >++++[<+++++++>-]<+.
            +++++++..
            +++.
            >>++++++[<+++++++>-]<++.
            ------------.
            >++++++[<+++++++++>-]<+.
            <.
            +++.
            ------.
            --------.
            >>>++++[<++++++++>-]<+.
        "#
    );

    let mut bf = Breakfast::new(Default::default());
    bf.run(program)?;

    Ok(())
}