Naive implementation of a brainfuck to x86-64 GNU assembly compiler.
Important
Please note that this is only compatible with Linux systems using an AMD64 processor.
GCC is also required to assemble and link the compiled output!
Install GCC if you haven't already:
For Debian-based distros:
sudo apt install gcc
For Arch-based distros:
sudo pacman -S gcc
Once you have done that:
- Download the precompiled binary in the Releases page
- Mark it as executable:
chmod +x bfc
- (Optionally) move it to your PATH:
sudo mv bfc /usr/local/bin # system-wide
mv bfc ~/.local/bin # per-user
bfc input.bf output
./output
or in one line:
bfc input.bf output && ./output
git clone https://github.com/bnjjo/bfc.git
cd bfc
cargo build --release
./target/release/bfc input.bf output
I have included a few fun brainfuck programs in the examples directory of this repo. Some of which are:
- ascii.bf – Prints all 256 standard + extended ASCII characters
- btc.bf by Katie Ball – A brainfuck to C interpreter
- cat.bf – A simple cat program, copies stdin to stdout (i.e. writes out whatever you input)
- hanoi.bf by Clifford Wolf – A towers of Hanoi problem simulation
- helloworld.bf by Katie Ball – You can guess what this one does lol
- mandelbrot.bf by Erik Bosman – A mandelbrot set fractal viewer
If you're interested in learning more about brainfuck check out this well-written tutorial by Katie Ball (the person who made the brainfuck to C interpreter and helloworld program!)