A Brainf*ck compiler for Linux.
bfc translates Brainfuck into C and immediately feeds it into GCC, producing small standalone ELF executables. No interpreters, no virtual machines, no runtime dependencies.
Just one command:
make
Just one more command:
cat input.bf | ./build/bfc > output
or:
echo "bf string" | ./build/bfc > output
Then running the program is as simple as:
./output
Brainf*ck source -> Lexer -> Parser -> AST -> C codegen -> GCC -> ELF executable
A simple Hello World! program is about 9.3kb big.
- Linux only
- Soft-requires GCC (could be substituted for something else)
- Finite memory tape (30kb)
Because interpreters suck.
Also because turning Brainf*ck into an ELF executable is just objectively fun.
MIT