Doom in Typescript Types took 3.5 trillion lines and a full year of work (2025)

Doom in Typescript Types took 3.5 trillion lines and a full year of work (1)

Doom has been ported to just about everything, right? Well, until now, the id Software title had not been recreated inside of Typescript's Types system, until now.

The feat was devised by Software Engineer Dimitri Mitropoulos, founder of Michigan Typescript and co-founder of SquiggleConf. He released a video showcasing the results of a year-long effort to get the game running inside of Typescript's Types system.

Typescript is a language built on top of Javascript, that add static typing to catch many errant mistakes before your executes, think of it as guardrails which check that functions and other variables are being used correctly. While this is commonly used in all kinds of development, it's unheard of to run a game within Typescript's Type system.

The port itself runs inside three and a half trillion lines of types, totalling a gargantuan size of 177 TB. This is run through Typescript's Type tracker, which takes 12 days to compile the first frame of Doom (0.0000009645 fps). This meant that 20 million type instantiations were running every second in order to get the output.

Mitropoulos explained in the Michigan TypeScript Discord server that this could be improved to take "1 to 12 hours", as long as someone works on it, with the developer noting that he has notes for where potential performance optimizations could be made.

This was done by running the project within a custom WASM runtime, which is then processed through Typescript within an editor to display a frame.

TypeScript types can run DOOM - YouTubeDoom in Typescript Types took 3.5 trillion lines and a full year of work (2)

Watch On

Mitropoulos explains that the project was a year-long struggle, due to having to write his own tools, including 12,364 handwritten tests, learning C, C++, WebAssembly, and other languages.

Stay On the Cutting Edge: Get the Tom's Hardware Newsletter

Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.

"I did develop what I believe to be the largest Typescript codebase ever", the author explained. Before optimization, he calculated that the project could take up to 1.25 Petabytes of data, with the first frame compiling after three months of continuous type instantiation.

Every type within the project was thousands of lines long, and the project involved developing a virtual machine inside of the Types system, complete with elements like RAM and Disk Space. "The computer is made of Typescript Types that serve as logical implementations of all 116 WebAssembly instructions Doom needs to run."

Mitropoulos further explained that each value within the Typescript Types system equates to a line of pixels, totalling 128,000 lines of pixels in total, resulting in a "resolution" of 320x200, displayed in ASCII.

To do this, the developer needed to remove limitations within the Typescript compiler itself, highlighting just how large the project got, with the Type tracker runtime consuming over 90 GB of RAM while it was running.

This huge overhead meant that common tools within Typescript could not be used, which meant that the herculean task of encoding every element of Doom in types. This required learning to develop elements like an L1 CPU cache, within Typescript Types itself. Due to Typescript requiring iteration on a single string from the left-hand side, binary algorithms had to be input in reverse.

"Oh, and AI can't help" Mitropoulos added, describing that the work was so low level that AI couldn't possibly assist with any of the tasks. Too bad, Grok 3.

Mitropoulos said that he undertook the challenge after completing "every other" Types challenge, and wanted to understand why Doom wouldn't be able to run within Types. However, he managed to find "ridiculous" workarounds to make it all work, despite his own disbelief in the project.

Mitropoulos is preparing two separate videos going into detail on why he created the project, in addition to another video with a technical breakdown of the feat. But for now, the gargantuan project is complete, and Doom has successfully been ported to yet another platform.

Sayem Ahmed

Subscription Editor

Sayem Ahmed is the Subscription Editor at Tom's Hardware. He covers a broad range of deep dives into hardware both new and old, including the CPUs,GPUs, and everything else that uses a semiconductor.

More about video games

Control Ultimate gets DLSS 3.7 support and new 'Ultra' settings — cuts performance nearly in halfPhysical game media might perish because of the 25% tariffs on imported discs

Latest

Intel appoints Lip-Bu Tan as permanent CEO

See more latest

2 CommentsComment from the forums

  • oe--

    I was reluctant learning Typescript. Now I know I should stay away from it😅

    Reply

  • john_kk

    Absolute madman, so much work for a meme, someone give this guy a job in R&D

    Reply

Most Popular

Intel appoints Lip-Bu Tan as permanent CEO
Congatec shows off acetone-based heat pipe cooling solution for extremely cold environments
Biwin launches 192GB DDR5-6400 and DDR5-6000 memory kits for AMD's AM5 platform
Chinese university designed 'world's first silicon-free 2D GAAFET transistor,' claims new bismuth-based tech is both the fastest and lowest-power transistor yet
The ‘world’s smallest microcontroller’ measures just 1.38 mm² and costs 20 cents
Asus anticipates price increases as it shifts production from China
UserBenchmark bashes AMD GPUs and claims they lack real-world performance
Voice controlled Raspberry Pi paper towel dispenser turns a prank into reality
Microsoft's latest Quantum computing claims have been named 'unreliable' by scientists
YouTubers Give New Meaning to “Air Printing”
Doom in Typescript Types took 3.5 trillion lines and a full year of work (2025)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Allyn Kozey

Last Updated:

Views: 6175

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.