Skip to content

on9au/brainfuck-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brainfuck-rs

Ahead-of-Time (AOT) compiler for Brainfuck, written in Rust.

why did i dedicate so much time to making a stupid brainfuck aot compiler bruh

Usage

# if you used other compilers like gcc/clang, etc. before, the cli syntax should be familiar to you.

# help command
brainfuckc -h

# shell completions
brainfuckc completions <SHELL>

# example compile with optimisation level 3
brainfuckc source_code.bf -o source_code -O3

Todo

in order of priority

  • other linker support for extra compatibility (like ld, lld, etc)
  • more optimizations like dce and stuff

Features

brainfuck-rs is a high performance AOT compiler for Brainfuck, written in Rust.

  • Focus on high performance
  • Ahead-of-Time (AOT) compilation
  • Multiple backends (cranelift, llvm, etc.) (note that this is TBC, currently only cranelift is supported)
  • Multiple linkers (gcc/clang, ld, lld, etc.) (note that this is TBC, currently only gcc and clang are supported)
  • Multiple optimizations (constant folding, dead code elimination, etc.) (more optimizations to be added)

Installation

install requirements:

  • rust (1.85.0 or later) (stable is preferred)

usage requirements:

  • a linker (gnu or clang supported only (for now...))

install steps:

  1. git clone this repo
  2. cargo build --release
  3. cd crates/bin/brainfuckc && cargo install --path . (this will install the binary to your cargo bin path if you want)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

(mostly) High Performance AOT Brainfuck Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages