Artem Lytkin has built a doom regex project that runs the classic game through regular expressions, according to the project page and GitHub repository. It works, in the narrow and deranged sense that it produces Doom frames, accepts keyboard input, and turns text replacement into a virtual machine slow enough to make patience feel like a hardware requirement.
Regular expressions, or regexes, are pattern-matching rules normally used to search and replace text inside programs. A regex can find a date, validate a string, or rewrite chunks of text. Lytkin’s project uses those same matching and substitution rules as computation rather than as a helper tool.
The implementation starts with a 96 MB plain-text string, according to Lytkin’s write-up. That string contains sections representing CPU registers, memory, a framebuffer for video output, the game’s WAD data, input and output, and other state needed to keep the fake machine moving. The regex engine repeatedly matches parts of the string and substitutes new characters, treating those characters as register values, memory contents, and screen data.
How does Doom run in regex?
Lytkin’s system treats text as the machine state and regex substitutions as instructions that update that state. Each replacement step changes the string in a controlled way, so the engine can emulate processor operations, read and write memory, and eventually produce the framebuffer Doom expects.
The project leans on the fact that sufficiently capable rewriting systems can perform general computation. Lytkin links the approach to Markov algorithms, a formal model where rules replace strings to carry out computation. That is the technical loophole being driven through with a chainsaw sound effect implied.
The cost is speed. Lytkin says one frame takes about 180 seconds to render. Each frame requires nearly 14 million substitutions, and the engine runs around 80,000 substitutions per second. Lytkin also says the output is byte-identical to the output of Doom itself.
The game can be controlled with keys, though Lytkin describes playing it as “closer to correspondence chess with a shotgun than to a twitch shooter.” That is not a benchmark category the GPU industry is ready for, but it is a precise user-experience report.
Why is the memory access not even slower?
Lytkin says the memory access scheme uses a binary-tree-like layout, moving from branch to branch with regex character-jump instructions. That avoids scanning the full 96 MB string over and over just to find the marker around memory.
The point, by Lytkin’s account, was less whether Doom could run at all and more whether it could do so “before the heat death of the universe.” The project page shows the regex machine running in both visual and text forms, while the doom-regex repository and demo release are available on GitHub.
Doom has been ported to odd devices and environments for years, including appliances and tiny embedded screens. Lytkin’s version pushes the tradition away from weird hardware and into weird execution models: a shooter rendered by the kind of text machinery developers usually deploy to find a misplaced digit.
This story draws on original reporting from Tom's Hardware.