Doom Ran Inside TypeScript's Type Checker. Here's How Types Execute Code
Book: The TypeScript Type System Also by me: The TypeScript Library — the 5-book collection My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub The first frame of Doom took 12 days to render. None of the game's code ran as JavaScript. The TypeScript type checker evaluated it, at about 20 million type instantiations…
In February 2025, TypeScript type checker demonstrated an extraordinary feat by running the entire Doom game using WebAssembly. The type checker evaluated 20 million type instantiations per second, producing Doom as a type. This was accomplished by Dimitri Mitropoulos, who wrote a TypeScript-based WebAssembly runtime and fed it a Doom program compiled to WebAssembly.
The TypeScript type system utilizes primitives such as conditional types, infer, and template literals to create complex type-level programs. In the case of Doom, types lived as binary two's complement digits inside string literal types. The type checker executed about 18 million instructions, one at a time, to render the first frame of Doom.
Three main limits were hit during this process: instantiation depth of 100, tail-recursive iterations of 1,000, and an instantiation count of 5 million. Each limit serves to prevent the type checker from hanging the editor due to excessively deep recursion or lengthy computations. The project needed up to 100 GB of memory but managed to complete the task in 12 days, resulting in 177 TB of data.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.