project
BrainFudger
A Brainf*ck compiler that generates real native binaries — eight targets, no compromises.
BrainFudger is a compiler for Brainf*ck — one of the most famous esoteric programming languages — that takes the job seriously. It doesn't interpret. It doesn't transpile to C and call a compiler. It reads your .bf source, validates the bracket structure, and writes out a genuine native binary for your target platform: ELF, PE, Mach-O, or MS-DOS, entirely from scratch.
The compiler ships eight binary backends, covering x64, x86, and ARM64 across Linux, Windows, macOS, and MS-DOS. Each backend hand-crafts the binary format — no linker, no libc, no external dependencies. The Linux targets emit static syscall-only ELF executables. The MS-DOS targets emit real 16-bit code that runs on DOS 5.0+, DOSBox, or actual vintage hardware.
It comes with native GUI hosts on each desktop platform — a Win32 app on Windows, an AppKit app on macOS, and a native desktop host on Linux — alongside the CLI. Both surfaces share the same compiler core.
Windows
macOS
Linux
MS-DOS
Eight binary backends
Pluggable emitter architecture — each of the eight targets writes its own binary format from scratch. No linker, no libc.
Bracket validation
Loop brackets are validated at compile time. Mismatched [ and ] produce clear errors before a single byte is written.
Tape bounds checking
The generated binary includes bounds checks on pointer moves. Stepping off either end of the tape reports an error at runtime instead of silently corrupting memory.
Native GUI hosts
Ships with a native Win32 app on Windows, an AppKit app on macOS, and a Linux desktop host — all backed by the same compiler core as the CLI.
Compile and run
--run compiles to a temp file, executes it immediately, then cleans up. Pair with --quiet-run to see only the program's output.
Custom branding
MSBuild BrandingDirective property switches between sanitised and uncensored builds — or activates the BrainFux0r alternate persona.
BrainFudger.exe hello.bf -o hello.exe --target win-x64 BrainFudger.exe hello.bf -o hello --target linux-x64 BrainFudger.exe hello.bf -o hello.com --target msdos-com BrainFudger.exe hello.bf -o hello --target osx-arm64
BrainFudger.exe hello.bf --run BrainFudger.exe hello.bf --run --quiet-run
BrainFudger.exe --list-targets
BrainFudger.exe hello.bf --target linux-x64 --cells 65536
Requires the .NET SDK. Clone the repo and publish a release build — the output is a self-contained executable.
git clone https://github.com/KiwiGeek/BrainFudger cd BrainFudger dotnet publish -c Release