bfc is a bad (probably) Brainfuck compiler.

It compiles only to x64 assembly, though there are flags that you can use to get your code assembled and linked into a standard Linux elf executable.

I wrote this compiler because I had no idea how to write compilers, and thought it might be interesting. It was very interesting and I still have no idea how to write compilers because Brainfuck is a very syntactically simple language and has very few possible operations. I’ll be working on a C compiler next instead. I didn’t think this through.


Grab the binary from the latest release.


Compile Brainfuck to x64 asm:

bfc -o hello.asm

Compile and assemble Brainfuck to x64 object:

bfc -a -o hello.o

Compile, assemble and link Brainfuck to ELF binary:

bfc -al -o hello

All of the above and run the resultant binary

bfc -r


View Github