No description
  • C 97.2%
  • Makefile 2.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-05 23:30:32 +02:00
src make it prioritise portability over binary size, lack of stdlib and raw mode 2026-07-16 02:53:36 +02:00
.gitignore Initial Commit, probably needs heavy code cleanup 2026-06-13 17:40:25 +02:00
LICENSE Add a README, replace the shell script with C code. Add a LICENSE. 2026-06-20 11:26:50 +02:00
Makefile Add a README, replace the shell script with C code. Add a LICENSE. 2026-06-20 11:26:50 +02:00
README.md Pattern matching optimizer and more 2026-06-20 20:12:29 +02:00

BFC - Brainf*ck compiler

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.

Build the compiler

Just one command:

make

Build a brainfuck program

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

How it works

Brainf*ck source -> Lexer -> Parser -> AST -> C codegen -> GCC -> ELF executable

A simple Hello World! program is about 9.3kb big.

Limitations

  • Linux only
  • Soft-requires GCC (could be substituted for something else)
  • Finite memory tape (30kb)

Why?

Because interpreters suck.

Also because turning Brainf*ck into an ELF executable is just objectively fun.

License

MIT