#brainfuck #macro #inline #brainfuck-compiler #execution #bf #splash

nightly macro bin rsfk

A library that provides inline brainfuck execution as macros

1 unstable release

0.1.0 Apr 2, 2024

#434 in Procedural macros

Download history 148/week @ 2024-03-29 18/week @ 2024-04-05

166 downloads per month

MIT license

9KB
137 lines

rsfk 🦀

Brainfuck "compiler", written with Rust, macros and a splash of ❤️

How to use this project?

Prerequisite

Command

  • cargo run to execute main.rs

Usage

Macro

inline_bf! ( (Instance of rsfk_core::BrainfuckState) {BF instruction} )

use rsfk;

fn main() {
  let mut bf = rsfk_core::BrainfuckState::<u32>::new();
  rsfk::inline_bf!( (bf), { ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. } );
  println!("{:?}", &bf);
}

// Hello World!

Roadmap, probably

  • Basic code
  • Cargo upload
  • Input fix (ParseIntError { kind: InvalidDigit })
  • Test cases
  • CI/CD on GitHub Action
    • Separate Cargo/ GitHub branch
    • Auto release onto Cargo when PR is merged to the branch
  • Optimizations
    • Repeated instructions into one function call
  • Standalone bf compiler?
  • Detailed control over the state of the machine?
    • Preload memory
    • Step execution (Possible?)

Dependencies

~475KB