A parser for TypeScript types, written in TypeScript types

by todsacerdotion 8/4/2025, 2:12 AMwith 38 comments

by johnfnon 8/4/2025, 4:58 AM

Sometimes at work I can't figure out some TS type and start thinking it's impossible. Then I remember that repos like this exist, and if some guy really managed to parse Typescript types in Typescript, that my problem is peanuts compared to that.

That usually motivates me to solve my problem.

by drejon 8/4/2025, 7:03 AM

For those not familiar with this kind of computing challenges, I must link this wonderful video about TypeScript types running... DOOM. https://www.youtube.com/watch?v=0mCsluv5FXA

by mpoteaton 8/4/2025, 7:20 AM

If folks are interested in this sort of thing, but want to play around with higher order building blocks, http://hkt.code.lol may be worth checking out.

In addition to type-level analogues of your normal Lodash-esque functions, it includes a suite of type-level parser combinator utilities and is built on higher-kinded type abstractions.

by tmcanadaon 8/4/2025, 4:13 AM

How does it compare to TypeBox?

https://github.com/sinclairzx81/typebox#syntax

by nottorpon 8/4/2025, 9:45 AM

I thought we have C++ for meta-meta-meta-meta programming...

Can you run your whole payroll app at compile time via TypeScript types too?

by ygritteon 8/5/2025, 5:12 AM

Has Doom been implemented yet in TypeScript types?

by maxlohon 8/4/2025, 11:46 AM

FYI, TypeScript's type system is turing-complete.

https://github.com/Microsoft/TypeScript/issues/14833

by owebmasteron 8/4/2025, 9:01 AM

Typescript looks more and more like a cult

by dvton 8/4/2025, 6:49 AM

(removed)

by valenterryon 8/4/2025, 9:35 AM

<Sorry, wrong thread>

by phplovesongon 8/4/2025, 12:55 PM

This is actually WHY i think typescript is going downhill. I feel the sweetspot was around 2.x (iirc) when things like this was not possible.

Everytime i hear Ocaml has a complex type system i refer them to Typescript.