#brainfuck-interpreter #brainfuck #brain-fuck

app ironmind

A Brainf*ck interpreter and code execution visualizer built in Rust

31 releases

0.3.13 Feb 11, 2024
0.3.12 Feb 11, 2024
0.2.8 Dec 17, 2023
0.2.3 Nov 29, 2023
0.1.7 Nov 28, 2023

#19 in Programming languages

Download history 368/week @ 2023-11-25 175/week @ 2023-12-02 43/week @ 2023-12-09 50/week @ 2023-12-16 50/week @ 2023-12-23 25/week @ 2023-12-30 1/week @ 2024-01-06 12/week @ 2024-01-20 34/week @ 2024-01-27 204/week @ 2024-02-03 378/week @ 2024-02-10 959/week @ 2024-02-17

1,575 downloads per month

MIT license

345 lines

The Iron Mind Interpreter

A BrainF*ck interpreter and code execution visualizer written in Rust

Crates.io Crates.io Crates.io

What is BrainF*ck

Installation Instructions


Run cargo install ironmind to install the application from crates.io.


Sample program:

++++++++++++[>++++++<-]>.           H
>++++++++++[>++++++++++<-]>+.       e
>+++++++++[>++++++++++++<-]>..      l (printed twice)
>++++++++++[>+++++++++++<-]>+.      o
>++++[>+++++++++++<-]>.             (comma)
>++++[>++++++++<-]>.                (space)
>++++++++[>+++++++++++<-]>-.        W
>++++++++++[>+++++++++++<-]>+.      o
>++++++++++[>+++++++++++<-]>++++.   r
>+++++++++[>++++++++++++<-]>.       l
>++++++++++[>++++++++++<-]>.        d
>++++[>++++++++<-]>+.               (exclamation)
>+++[>+++<-]>+.                     (new line)

Run Program

ironmind myfile.bf


Hello, World!

Visualize Execution

ironmind -v myfile.bf

Output: visualizer

Build Instructions

System Dependencies

  • Rust
  • Cargo

Rust Dependencies (These install automatically)

  • Clap for processing command line arguments and flags
  • Cursive for TUI

Build Notes

  • Cursive is a wrapper around the ncurses linux library
    • If this library isn't present on your machine then it must be installed before ironmind can be built
    • On debian systems ncurses can be installed using sudo apt install libncurses5-dev libncursesw5-dev

Run for Debugging / Testing

git clone https://github.com/Jadens-arc/Ironmind
cd Ironmind
cargo run myfile.bf

To run automated tests run

cargo test

Tests are found in src/tests

Compiling Executable

git clone https://github.com/Jadens-arc/Ironmind
cd Ironmind
cargo build --release

The executable will be found at target/release/ironmind

Run using ./ironmind

Feel free to move it to a Bin/ directory if you want

If you do move it, you can use ironmind myfile.bf anywhere on your system

Also, I found this really cool BrainF*ck program from 2005 that outputs 99 Bottles of Beer by Andrew Paczkowski

Definitely worth checking out


~117K SLoC