Artem Lytkin built a working DOOM engine that runs entirely through regular expressions, using a 96.6 MB text string to encode CPU registers, RAM, a framebuffer, the DOOM engine compiled to a custom instruction set, and the game's WAD file.

A C-based driver applies a fixed, ordered sequence of find-and-replace regex rules to that string. Each frame requires more than 10,000 substitutions. At 80,000 substitutions per second on Lytkin's test system, the result crosses into a marginally playable framerate.

The full project is on GitHub with Python source, the C runtime, and the complete regex ruleset. Read the original to understand how a Turing-complete regex system gets compiled down to something that can actually tick a game loop, because the architecture decisions behind that 96.6 MB string are where the real story lives.

[READ ORIGINAL →]