TypeScript types can run DOOM [video]
390 comments
·February 26, 2025notfed
LAC-Tech
I don't thinks statements like this are meant to be read literally in American English.
IE US English speakers always fond of telling me how they work X hours in a day, or they went N days without sleep. Which used to really impress me, until I realised "wait... do they just exaggerate as matter of course"? And then I realised - of course they do; these are people for whom every purchase is an "upgrade"; where a bicycle for commuting in a city is an "urban assault vehicle", rich creamery butter, rich creamery type systems, etc etc.
So no, I sincerely doubt they actually worked 18 hour days for a year straight. I'm sure they worked hard, but it's just the way Americans talk.
gr4vityWall
> I don't thinks statements like this are meant to be read literally in American English.
I don't know, when I got hyperfocused on a side-project a few years ago, I was dedicating almost all my awake time to it. 12+ hours a day, every day, including weekends, for months.
Surprisingly, I didn't burn out. I was just so interested in it, I couldn't stop, and even started neglecting other things to work more on it.
I never hit such a focus state since that time in 2017~2018.
KPGv2
This happened to me once. It was like attaining enlightenment. My company worked with a F100 that had, as a core piece of their business, a piece of software they'd commissioned in the 80s that they still used in the 2010s to make billion dollar decisions. But no one knew how it made the calculations they relied on. This was before attorneys knew to include source code in procurement, the original devs at a third party code shop was long gone.
We were already working on something for them, and on a whim, one of their VPs asked my company if we could take a look at it.
So that's how the mathematician at the company (me) ended up waking up, sitting in front of a whiteboard, and losing all concept of time until my wife got home from work at night, not eating, not sleeping, staring at decompiled assembly and stepping through line by line for weeks. (I don't want to say months because I'm sure someone will come roast my ass for taking too long, but "months" is honestly more accurate; in fairness, I was learning every technique used on the fly)
It was a prolonged, repeated flow state that I've only ever experienced during really competitive tennis as a high schooler. Losing all concept of time and space, hyper focused on one task that has completely spread to all parts of your consciousness.
hn_throwaway_99
I think both of you are correct:
1. I've also been it a hyper-focused state where I was so intent on what I was working on I would spend basically all my time on that project without burning out. Like you, I haven't hit that focus state for a long time.
2. "18+ hour days", consecutively, is almost certainly an exaggeration, and this is where I agree with the parent commenter. For some reasons Americans (I am American) love talking about how much time they work and how little sleep they get. Realistically, very few people (except a small percentage of genetic outliers) can get by on sub-6 hours of sleep for long.
nkrisc
That's correct. Hyperbole and dramatization of real events was entirely unknown to the world until it was invented in a rural Nebraskan town in 1854 (pre-statehood). It's been a staple of American speech ever since. Only recently has it begun to find a footing outside of the United States. It's a similar story with Comedy, as well.
LAC-Tech
I never said it was only in American speech, just that it's very, very common, to the point where a lot of what Americans said made less sense to me until I realised it.
Different cultures express things differently. Overstating, understating, etc etc. If you want to understand, and be understood, it's important to know.
creativenolo
The does video starts off with some serious hyperbole (noted for anyone reading this comment before watching the video)
jh00ker
So much hyperbole that I thought the entire video was a spoof on the practice of making a Doom proof until about a minute in, where I asked aloud to an empty room, "Wait, this is real?"
Also, he forgot to credit the video itself, which has a really high production value! Kudos all around!
nmeofthestate
I work with Americans and never experienced this from any of them - are you sure you're not... exaggerating?
lofaszvanitt
not with the youtube types. who say: I spent 670 hours trying to defeat this boss and died 555 times.
rob_c
From experience, be careful if you ever called them out, just let them be.
posterman
I think you are confusing hyperbole with poetic license, and overstating the effects it has on English vernacular. I am not American, but I wouldn't go around minimizing how industrious the "great society" is.
jack_riminton
Yeah I worked out the "N days without sleep" was mostly rubbish too.
I personally went for 3 days without any sleep in the army as part of a sleep deprivation exercise and it was one of the most brutal things I've ever done, I fell asleep standing up whilst digging a trench, ouch.
So I know when people say "I literally haven't slept in 6 days", they very much don't mean literally, they normally mean they went to bed and had a few hours of sleep per night.
null
draculero
> year long journey of 18 hour days
I couldn't do it, even if I had the talent. I have to work to get money!
tossandthrow
At 18 hours of work a day, your money need are relatively low! Pair that with just sleeping at the office toilet and eating used coffee grounds and everything should be good!
dev0p
Living is cheap if you don't live.
Not to detract from the achievement, that's amazing. Mostly useless, but amazing nonetheless.
dimitropoulos
the low(er) cost of living here in Michigan is absolutely a factor of the story! haha.
revskill
You are a bad trader
axkdev
We already new that TS types are Turing complete so it's more of demonstration than a proof.
UltraSane
He wasn't being serious.
38
[flagged]
DrammBA
what's with hn being filled with assholes lately?
chamomeal
The amount of “why would somebody waste their time with this” comments is pretty surprising.
This guy is a legend now. Every developer slack channel at my company is buzzing about it
esperent
It's happened in the last couple of months, a clear uptick in aggressive comments. I'd hazard a guess at people using HN as an outlet for feeling angry and helpless about the US political situation.
stevage
It's obviously for the person who did it.
tracerbulletx
The video will probably do pretty well, giving him some personal traction for his channel or reputation. Also because hackers gonna hack.
kaonwarb
He wanted to do it. Didn't hurt anyone. Why criticize?
digdugdirk
Pushing the frontier is an end unto itself. The pure excess of this endeavor is a huge feat, and I for one am happy to enjoy just witnessing it.
flanbiscuit
"But I'm not one of those fancy 10x developers. Instead of a master of craftsmanship, I'm more a master of close-enough-manship"
I definitely relate to this comment.
and he also says "It was a brutal year long journey of 18 hour days"
I think people are looking for those unicorn 10x devs that are like Good Will Hunting for code, but forget that there are those devs that might not get things right away but never stop until they figure things out. You'll probably find a lot more of those than the unicorns
Aeolun
I love that there was a moment when I realized that all these things where I could’t understand how someone could possibly figure out a trick to create them didn’t use any trick at all. It was instead just mountains of hard work.
I would spend weeks looking for the magic that would allow me to do it in hours when others would just spend the days or weeks required to actually do it.
I’m much better at making things now, and have people asking me how I manage to do that.
je_bailey
One of the things I like to mention to younger devs, when I pull out a solution that they think is from thin air, is that I have failed far more often then they have. I just have a good memory on how to fix my mistakes.
ipaddr
Those are the unicorns
1oooqooq
society create the überman myth to keep the working class down, thinking they will never be the top of their game. the ones doing the hiring know that those putting in 18hrs a day are the unicorns, i.e. the best they can hope to find.
JohnMakin
I’m close to one of these types and I get taken advantage of a lot and desperately wish I could turn it off. It presents in weird ways that are hard to navigate politically - often I will end up on a team and be outputting a large majority of the work, people/egos get hurt or threatened, still inevitably make the same anyway. It's never really led to any kind of career or financial success I'd have thought it would have years ago.
hi_hi
I was accidentally one of these once.
I fixed a long standing bug that was a companies top priority for several months and no one had been able to fix it. They were talking about re-writing an entire app to resolve it, at a cost of 100's of thousands of dollar, dragging the vendor over the coals etc.
I was relatively new and thought I'd take a look, ignoring all the mystique surrounding the problem. It turned out to be a simple one line fix, just a dumb oversight that anyone who bothered to understand and step through the code would have caught.
Things got a little weird after that haha. The director who had been responsible for that department started ignoring me, while I started to get pulled into look at all sorts of other peoples urgent issues, with zero context, often with a team of other people I didn't know on the call.
It was fun while it lasted, but man, I'm glad I'm no Doogie Howser MD, that shit would go to your head!
gottorf
> society create the überman myth to keep the working class down, thinking they will never be the top of their game
What? The distribution of talent and grit being what it is, ubermen do exist. Some people are naturally tall, good-looking, able to recite pi to the 50th digit, solve challenging analytical problems, put in long hours when necessary, and get along with the in-laws.
Of course, the ones doing the hiring probably know that such people won't stay in the position for long. But it's not a myth, and certainly not one to keep anyone down.
tanepiper
I can also relate - I'm a tech lead, and it just also happens to be I find programming to be an enjoyable puzzle. When my wife sticks on some TV, I'll usually scratch an itch with some problem I've spotted, or some improvement that can be made - most of our docker build time improvements are me trying out different things and finding what works - same with little QoL features.
Props to the dev of this project though - in some ways this kind of project is one of those 'magnum opus' things - not many people might know or care about it, but it's actually something to be proud of achieving.
kcrwfrd_
Surely it’s a balance but I feel like relentless drive and focus might even be a little more important than raw intellectual ability.
epolanski
> and he also says "It was a brutal year long journey of 18 hour days"
Which is likely an hyperbole.
usrusr
But is it technically untrue if the start date and the end date are more than twelve months apart and some of the days between those dates saw 18 hours of work on the project? Arguably it could be both, not technically a lie but hyperbole nonetheless ("37h split between two days a year apart").
null
sarasasa28
I agree with you, and with the comment but.. Come on, this guy is not THAT type of guy
dfabulich
A WASM runtime in TypeScript types is impressive in its own right, but I think I can dimly see how it could work with a lot of effort. https://github.com/MichiganTypeScript/typescript-types-only-...
What I don't understand is how this thing does keyboard input.
At 3:42, the video simply says, "And, yes, there's a way to do keyboard input," without elaborating on how. What sorcery is that? There must be something outside the type system translating keyboard input into TypeScript types…??
dimitropoulos
(author here) pause on that screen and look at the code displayed on the right (as well as the note at the bottom!) the way to do keyboard inputs is basically exactly what people do for tool assisted speedrunners. Some people at this point in the message just went "oh cool!" and others went "you liar! that's not the same thing!". There was SO MUCH to say in 7 minutes in a short video like that, but rest assured, I'll go into depth on that in the next videos. The pong stuff that's shown is real (only the animating part was the creative liberty) and it's in the open source codebase.
darcien
I haven't checked the DOOM one, but for the Pong example, the keyboard input is prerecorded. As in the sequence of the keyboard key press are sequenced in a TS array[0].
[0]: https://github.com/MichiganTypeScript/typescript-types-only-...
dimitropoulos
yep! exactly this! like how a tool assisted speedrunner works
Jare
That's also how the Doom demos worked right? :D
pcthrowaway
If I had to guess, it's a file with an array of keys pressed (or unpressed) at some time interval (say 0.1 seconds). Then a VS code extension can append to the array every 0.1 second along with any key-press states at that time. The compiler updates the game state whenever this array gets updated.
However, I'm guessing this is why we see a demo of pong and not doom. Doom probably just can't keep up with this.
No idea if I'm remotely on the right track here though.
sangeeth96
Blew my mind! Dimitri talks about it in the video but I love the mention of how this project came to be[0]:
> This engine was built to service a project that aimed to demonstrate why Doom can't run in TypeScript types. Well. The funny thing is.. It can.
[0]: https://github.com/MichiganTypeScript/typescript-types-only-...
sn9
What was the argument for why it couldn't?
mbb70
Because we lack an infinite tape and infinite time, not everything that is Turing complete can run DOOM
n2d4
Or more specifically, everything that is Turing complete can run DOOM, but most languages are only Turing complete under certain assumptions which are not met in practice
akie
> not everything that is Turing complete can run DOOM
Beware with such blanket statements, you might inspire someone to do 18-hour days for a year to prove you wrong.
zelphirkalt
Not having infinite tape is true for all computers though. And probably also not infinite time as well.
LoganDark
He tried and tried and tried to find one and accidentally proved instead that it could.
acemarke
I got to watch Dimitri posting internal updates about his progress on this, and it has been utterly mindblowing. This is genuinely one of the most amazing things I've ever seen done with code. Absolutely legendary feat! (And also an incredible amount of persistence.)
pcthrowaway
Where can we see these updates?
dimitropoulos
the #doom channel is where Mark is referring to. it's all there!
sys13
Michigan Typescript has an active discord: https://discord.com/invite/DHtwNDTwrR
dgunay
I am at the same time both amazed and utterly unsurprised that this was possible, given all the hullaballoo about TypeScript's type system being Turing complete. Having the grit to actually go through with it though? Bravo.
akkad33
I have seen papers saying at least Java and Python type systems are turing complete. I wouldn't surprised if all type systems are turing complete
mseepgood
No, good language designers take care that their type system is not Turing complete.
pornel
Is there a mainstream language where this still holds true?
From what I've seen most languages don't want to have a Turing complete type system, but end up with one anyway. It doesn't take much, so it's easy to end up with it accidentally and/or by adding conveniences that don't seem programmable, e.g. associated types and type equality.
akkad33
Can you give an example of such a language that is type safe (which removes C)
Rzor
If there's one top story HN deserves today, it has to be this. Absolutely insane and incredibly inspirational.
karmakaze
My literal LOL of the month. Love the types scale graphics/animation. :mind-blown:
aylmao
At this point the easiest way to know if a system is Turing complete is to check if someone has ported DOOM to it haha
Very impressive!
cobbal
Only if the church-turing-carmack thesis holds, which I personally doubt
ccvannorman
Alternatively if The Romero Hypothesis is proven to map the distribution of Mancubus numbers ... >_<
kridsdale1
If it holds does that confirm that I’m his bitch?
FergusArgyll
HN Pedantism never fails to elicit a chuckle from me
khazhoux
Most people would agree that Mengelberg‘s 1984 paper clearly answers that question … of course, we all know that his language is famously hard to parse!
vardump
Doom compiled to just 177 TB (terabytes) of TypeScript types. Amazing on many levels.
luckystarr
This must be the quintessential example of a Turing tarpit.
In TypeScript types, everything is possible, but nothing of interest is easy.
hoppp
Amazingly inefficient. But I would not be able to reproduce this feat so hats off.
saagarjha
I mean it’s a very efficient implementation of the inefficiency.
tgv
For the first frame...
abound
I think that 177 TB is for the whole shebang, it's just that it took 12 days to render the first frame.
dimitropoulos
both this and parent comment are right! once you have the first frame, it's probably just a few hundred more megabytes to get the second one - although I won't be the one to find out! 1 is enough for for me!
sys13
Not only is Dimitri an amazing engineer - he's also great at building community and event/video production. Michigan Typescript meetups and videos have a level of polish that goes over and above
jschoe
In the YouTube comments he stated nonetheless that he still bombed big tech interviews, specifically the technical portion, probably because of some ridiculous LeetCode problem he did not memorize beforehand. It just goes to show how these procedures do not effectively determine who is actually a good engineer or programmer. If this guy can't land a job while achieving this, then something is not quite right with the interview process.
dimitropoulos
hi! yep! this definitely happened. I do mention it in the next "why" video, but it's good feedback to know this is interesting to people because I could say a bit more about what those rejections were like - specifically the one where I failed the technical screening.
I'm actually really excited to share that part of the story because I hope it can be a small thing in the back of people's mind to help them if it happens to them. It can happen to anyone. Interviews are SUCH a lossy process and most engineers I know don't have any training on how to do interviews at all - yet we just assume they know how to evaluate people's skillsets.
hakaneskici
What you've accomplished demonstrates a very important skill you have, persistence. Kudos and don't give up.
About those rejections, did they effect your confidence in yourself and your skills? How did they make you feel?
seivan
[dead]
mattgreenrocks
Those interviews select for the type of person that believe it is worthwhile to dump tons of time into studying minutia to succeed at those types of interviews.
The purpose of a system is what it does, after all.
adam_hn
You're making an excellent case for using AI during the interview. If you can actually code and do the work, you're hurting no one by using tools to get past these arbitrary barriers during the live interview. The system is clearly flawed when someone demonstrably skilled gets rejected over trivia.
I actually created a tool to help myself get through the live interviews, specifically by listening to the questions and giving me real time answers to things I couldn't recall under that kind of pressure. It's not about not knowing the material, it's about the ridiculous expectation to perform perfectly on demand.
sam_david__red
[dead]
stevage
OTOH he points out that he learnt an enormous amount during this project specifically, so probably much more employable now.
kamilafsar
That's pretty insane Dimitri. If you like stuff like this I really recommend Dimitri's TypeScript challenges series: https://www.youtube.com/playlist?list=PLOlZuxYbPik180vcJfsAM...
bilekas
This shouldn’t be possible.. Typescript devs have lost their collective minds and I’m totally here for it.
Edit : TS not front end
dimitropoulos
I didn't ask them outright, but I sorta think the TypeScript team might agree with you on this point! haha. At least we can all agree it's not an intended use-case, to play Doom.
winwang
Counterpoint, it absolutely should be (barring the pedanticness of modding it a bit): https://news.ycombinator.com/item?id=37555651
> "It was a brutal year long journey of 18 hour days" [to run doom in TypeScript types]
This is some serious dedication for what at first blush may sound to many to be a completely unserious, or even useless, achievement. But I say to those people: a DOOM proof is just as worthy of praise as any other academic mathematical proof, and has the advantage of being verifiable by laymen.
Congrats on this amazing achievement.