Live data from Hacker News

TypeScript types can run DOOM [video]

youtube.com

281–290 of 391 posts

Re: TypeScript types can run DOOM [video]

#281
post #277
post #32

Doom compiled to just 177 TB (terabytes) of TypeScript types. Amazing on many levels.

Amazingly inefficient. But I would not be able to reproduce this feat so hats off.

I mean it’s a very efficient implementation of the inefficiency.

Re: TypeScript types can run DOOM [video]

#282

Earlier quoted context omitted.

Sure, there's many other ways to type it, but none adds any kind of additional safety or strictness over Record which was my point that `any` is the correct type in many cases, except when it widens a type. But in my case it's not widening anything, in Record , B can already be `any`thing. People tend to see it as an unsafe escape hatch (which is how it is abused), but it's just a set of all possible types.

> it's just a set of all possible types `unknown` is the set of all possible types (it's the top type[0]). `any` goes beyond that—it basically turns off the type checker[1][2]. [0]: https://en.wikipedia.org/wiki/Top_type [1]: https://tsplay.dev/mA9vXm [2]: https://www.typescriptlang.org/docs/handbook/2/everyday-type...

Your 1 isn't equivalent to my example, line 11 is not constraining the type.

Re: TypeScript types can run DOOM [video]

#284

I'm sorry to rain on this parade, but I fail to see the merit of spending so much effort - and writing so much code, generating so much data, working 18hr days etc. - to render Doom in TypeScript type-checker. I mean, there all sorts of feats and achievements one could choose as one's goal, which would also be impressive, but would be more useful to users and/or software developers, than this. I'm just thinking of al…

Yes, but think of how much joy it brings to so many people.

Re: TypeScript types can run DOOM [video]

#285

Earlier quoted context omitted.

Sure, there's many other ways to type it, but none adds any kind of additional safety or strictness over Record which was my point that `any` is the correct type in many cases, except when it widens a type. But in my case it's not widening anything, in Record , B can already be `any`thing. People tend to see it as an unsafe escape hatch (which is how it is abused), but it's just a set of all possible types.

'any' has always been intended as an escape hatch, so no abuse here [1]. The type representing the set of all possible values (the top type in the type lattice) is 'unknown'. [1] https://www.typescriptlang.org/docs/handbook/2/everyday-type... [2] https://www.typescriptlang.org/docs/handbook/release-notes/t...

unknown is not equivalent to any as a type constraint: doesn't work.

https://www.totaltypescript.com/any-considered-harmful#type-...

Re: TypeScript types can run DOOM [video]

#286
post #129

Earlier quoted context omitted.

Maybe the catch was in saying that left right labels are arbitrary, could be called node1 and node2 as well, inverting is not necessary per se, just visit it in node2, node1 order if needs to be flipped - ie. no physical rearrangement is necessary.

Also the best answer to "how do you reverse an array". You don't. You just read it in the opposite order. Especially in any iterator-based language it should be trivial. In a pure ASCII world, this doubles as "how do you reverse a string". In a Unicode world, the answer to "how do you reverse a string" is "you should never want to do that".

Right, but sometimes you actually do have to reverse the array.

Re: TypeScript types can run DOOM [video]

#287
post #93
post #88

Earlier quoted context omitted.

Is this your reaction when someone climbs a mountain? "Bipedal locomotion was shown sufficient for climbing mountains centuries ago, given reasonable assumptions about the terrain, why should I be impressed?" Doing things can be difficult and admirable, even if it was confidently believed possible beforehand.

> Is this your reaction when someone climbs a mountain? My reaction then isn’t “wow, this blows my mind that it’s possible”. The first time someone climbing Mount Everest 72 years ago was impressive and possibly astounding. Nowadays, not really that much.

It’s still impressive if your manager does it. Or your date. Or your mom.

Re: TypeScript types can run DOOM [video]

#289
post #191

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.

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

Re: TypeScript types can run DOOM [video]

#290
post #179

> "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 achievemen…

> 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!

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!
Post reply on HN