r/itrunsdoom • u/Fine_Personality_296 • 12h ago
Doom in BF
We have compiled doom to one of the hardest programming languages in the world: Brainfuck, creating the most complex BF program even. It runs at a blazing speed of 40 seconds per frame, and it took about 2 days to beat the first level.
Brainfuck is an esoteric programming language created in 1993 with the goal of having a really small compiler. As a result, the language is extremely minimal, consisting only of 8 unique instructions.
We used actuall DOOM source code, then replaced all calls to the operating system with our custom ones: doom.wad was hard-coded into the executable, the allocator was replaced and made to just use a buffer instead of requesting memory from the OS, the graphics were made to write raw image data to stdout, etc. Then we compiled it to a statically linked RISC-V executable, and converted that to brainfuck.
Link: highghlow .ru/doombf (can't be a link because reddit hates the web apparently)