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.

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

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

U.S. Atari parts store still open after 41 years, has spent $100K+ designing new parts — last original Atari hardware launched 32 years agoSNES consoles appear to run faster with age — APU frequency increased by up to 182 Hz after 35 years

Latest

Newegg is selling this speedy 1TB PCIe 4.0 SSD at 6 cents per GB

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

Nvidia RTX 5060 Ti final specs and launch day allegedly leaked
GPU compatibility dilemma brewing as more high-end power supplies ditch 8-pin connectors in favor of new 16-pin
Nvidia RTX Pro 6000 Blackwell GPU is listed for $8,565 at US retailer — 26% more expensive than the last-gen RTX 6000 Ada
‘Frequently returned item' warning slapped on Snapdragon X-powered Surface Laptop 7 at Amazon
Chinese scientists create 'breakthrough' solid-state DUV laser light source for chipmaking tools
EU preps Chips Act 2.0 to strengthen semiconductor industry after original program reportedly flopped
AMD launches Gaia open source project for running LLMs locally on any PC
Enthusiasts report Gigabyte X870E Aorus Xtreme chipset temps exceeding 100°C
'Pi Tin' retro gaming handheld is minty fresh thanks to a Raspberry Pi Zero 2 W
Microsoft says DirectX Raytracing 1.2 will deliver up to 2.3x performance uplift
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: Amb. Frankie Simonis

Last Updated:

Views: 6717

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.