32 releases (2 stable)

1.1.1-next.8 Nov 8, 2024
1.1.1-next.6 Oct 27, 2024
1.1.0 Jul 19, 2024
1.0.0 Jan 5, 2024
1.0.0-alpha.4 Jul 5, 2023

#94 in Programming languages

Download history 4/week @ 2024-08-17 97/week @ 2024-08-24 15/week @ 2024-08-31 1/week @ 2024-09-14 104/week @ 2024-09-21 18/week @ 2024-09-28 3/week @ 2024-10-05 1/week @ 2024-10-12 99/week @ 2024-10-19 90/week @ 2024-10-26 224/week @ 2024-11-02 63/week @ 2024-11-09 5/week @ 2024-11-16 2/week @ 2024-11-23 47/week @ 2024-11-30

191 downloads per month

MIT/Apache

275KB
4K SLoC

Brainfoamkit

GitHub release (latest by date) GitHub tag (latest SemVer) Continuous integration REUSE status

This project aims to implement a brainfuck interpreter in Rust. In addition, this also aims to provide a terminal-based TUI for stepping through and understanding the brainfuck programs.

Builds

Stable Beta Nightly MSRV (1.75.0)
Linux Ubuntu x Stable Rust Ubuntu x Beta Rust Ubuntu x Nightly Rust Ubuntu x MSRV Rust
Windows Windows x Stable Rust Windows x Beta Rust Windows x Nightly Rust Windows x MSRV Rust
macos macos x Stable Rust macos x Beta Rust macos x Nightly Rust macos x MSRV Rust

Rationale

Brainfuck is an interesting esoteric language. It is turing complete and can essentially be used as a general purpose programming language. However, it has only 8 individual symbols that are used to instruct the interpreter. This makes it both fun and challenging to implement.

While several C and C++ interpreters for Brainfuck exist, I believe that it is particularly well suited for implementation in Rust due the combination of memory-safety, speed and zero-cost abstractions. Additionally, the interpreter is expected to be non-trivial in complexity while still only scratching the surface of the features Rust has to offer. Thus, it provides an excellent educational opportunity for someone trying to learn Rust.

Details

The major details for the project are available in the BrainFoamKit Book.

(Planned) Features

  • A complete brainfuck interpreter capable of ingesting a brainfuck program and behaving appropriately
  • A modular system for the said interpreter, allowing for extensions and modifications
  • A configurable brainfuck virtual machine to interpret the programs.
  • A fully capable TUI to visualize and step through a brainfuck program

Current Status

  • Implement basic building blocks for the Virtual Machine
  • Implement the Virtual Machine to run the code
  • Implement a parser for parsing the input program
  • Design the TUI for the visualizer
  • Implement the TUI with the Virtual Machine and parser

Contributing

See the Contributing for details on how to contribute to the project.

You can contribute to the project through GitPod.

Open in Gitpod

Code of Conduct

This project is governed by the Contributor Code of Conduct Covenant. Details are outlined in the CODE OF CONDUCT.

Dependencies

~10–21MB
~304K SLoC