#brainfuck #debugging #behavior #eof #bf

breakfast

A Brainfuck interpreter in Rust

4 releases

Uses new Rust 2024

0.1.4 Jun 1, 2025
0.1.2 Apr 26, 2025
0.1.1 Apr 25, 2025
0.1.0 Apr 18, 2025

#702 in Programming languages

Download history

300 downloads per month

MIT/Apache

8KB
125 lines

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(())
}

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(())
}

No runtime deps