yabf_rs 0.1.2

A simple crate that can be used to embed Brainfuck programs into your Rust programs.
Documentation
  • Coverage
  • 40%
    14 out of 35 items documented0 out of 9 items with examples
  • Size
  • Source code size: 26.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 551 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • serd223/yabf
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • serd223

Yet Another Brainfuck Interpreter

Crate API

yabf_rs is a simple crate that can be used to embed Brainfuck programs into your Rust programs. Documentation on docs.rs

Features

  • Can parse and execute Brainfuck code.
  • Highly customizable IO system.
  • Allows you to inspect/modify data about your program during runtime.

Basic example

The following program outputs the letter 'H' to the terminal.

use yabf_rs::*;
fn main() {
    let program = Program::from(">++++++++[<+++++++++>-]<.");
    let mut bf = BfInstance::from(program);
    bf.run(&mut default_input_source, &mut default_flush);
}

More examples

For more examples, look at the examples directory in the repository.

Running examples

Prerequisites

git clone https://github.com/serd223/yabf
cd yabf
cargo run --example hello_world

Example projects written using yabf_rs

yabf_cli

  • yabf_cli is a simple command line tool for debugging/running Brainfuck code.

yabf_gui

  • yabf_gui is a proof of concept project that uses egui with the eframe framework for the GUI part.

Adding yabf_rs to your project

cargo add yabf_rs

Why yabf_rs instead of just yabf?

yabf was already taken...