Developer Artem Lytkin has managed to run the classic 1992 game Doom using only regular expressions. This unconventional implementation highlights the computational capabilities of regex, typically used for text pattern matching and substitution.
Lytkin created a 96 MB plain-text string that functions as a virtual machine, containing sections for CPU registers, RAM, video output (framebuffer), and game data. Regular expressions then perform text-matching and character substitutions within this string to simulate processor operations and memory access. Memory access was optimized using a binary tree structure to avoid scanning the entire 96 MB string repeatedly.
The performance of this regex-based Doom is extremely slow, requiring approximately 180 seconds to produce a single frame of game output. Each frame involves nearly 14 million text substitutions, with the engine processing 80,000 substitutions per second. Despite the slowness, the output is byte-identical to the original Doom, and the game can be controlled, though the experience is described as akin to "correspondence chess with a shotgun."
This project serves as a demonstration of the Turing completeness of regular expressions, proving that they can theoretically perform any computation. While impractical for actual gaming, it showcases creative problem-solving within programming constraints and contributes to the ongoing tradition of running Doom on unusual platforms.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Artem Lytkin successfully implemented Doom to run entirely within regular expressions, a text-matching utility. This achievement demonstrates the Turing completeness of regular expressions, albeit with extremely slow performance, rendering one frame every 180 seconds.