Live data from Hacker News

TypeScript types can run DOOM [video]

youtube.com

61–70 of 391 posts

Re: TypeScript types can run DOOM [video]

#61

Honestly every time I worked on TypeScript codebase and the type definition "any" started popping out more and more often, I felt I'm starring into the abyss.

There are valid use cases for any (such as type constraints).

Playground with example here: https://tinyurl.com/5ahs366a

Re: TypeScript types can run DOOM [video]

#64
Amazing work. I'm interested in the choice of WASM - presumably any target that can run DOOM could've been used? Of which there are innumerable choices I assume. Was it for symbolic reasons or genuinely the most useful target?

Re: TypeScript types can run DOOM [video]

#65

Not to be a grouch, but I feel like this could be way more optimized

It's a bit that it is oversold, but it's a cute little VM.

https://github.com/MichiganTypeScript/typescript-types-only-...

Though the fact that the actual converter that converts from WASM to TypeScript types is in Rust makes it lose a bit of charm, but still.

Like Flappy Bird in TypeScript types did: https://zackoverflow.dev/writing/flappy-bird-in-type-level-t...

Re: TypeScript types can run DOOM [video]

#67

Honestly every time I worked on TypeScript codebase and the type definition "any" started popping out more and more often, I felt I'm starring into the abyss.

There are valid use cases for any (such as type constraints). Playground with example here: https://tinyurl.com/5ahs366a

That was the tipping point in transition from "we are serious and use static typing instead of lame JavaScript" into "ok we lost control over this thing".

Re: TypeScript types can run DOOM [video]

#68

Earlier quoted context omitted.

There are valid use cases for any (such as type constraints). Playground with example here: https://tinyurl.com/5ahs366a

That was the tipping point in transition from "we are serious and use static typing instead of lame JavaScript" into "ok we lost control over this thing".

What do you mean?

This is perfectly sound and valid from both a practical and theoretical pov.

Which is why I was pointing out that there are scenarios like constraints where any not only makes sense but is the correct type.

Re: TypeScript types can run DOOM [video]

#69
post #64

Amazing work. I'm interested in the choice of WASM - presumably any target that can run DOOM could've been used? Of which there are innumerable choices I assume. Was it for symbolic reasons or genuinely the most useful target?

WASM is the easiest target because you don't have to emulate an entire computer.

Re: TypeScript types can run DOOM [video]

#70
post #64

Amazing work. I'm interested in the choice of WASM - presumably any target that can run DOOM could've been used? Of which there are innumerable choices I assume. Was it for symbolic reasons or genuinely the most useful target?

WASM is one of the easier platforms to port as the Virtual Machine is well documented and there are actual implementations in many languages that can be used for debugging and comparing the results.

even in pure JS: https://github.com/evanw/polywasm

Post reply on HN