by kaleidawave on 9/22/22, 4:58 PM with 98 comments
by brundolf on 9/23/22, 4:26 PM
I've been working on a new TypeScript-like language myself from scratch, which among other things takes this approach. Mine can do some of the numeric stuff shown here, but I'm jealous of (inspired by? :)) some of the crazier stuff going on here, like usage-based argument types and tracing not just value shapes but value reference identities
The "automatic generics" feature in particular is absolutely bonkers. It never even occurred to me that you could do that. I'm wondering if there are unforeseen edge-cases, but also wishing I had it at work. Clunky generics syntax is one of the worst parts of TypeScript, even while generic function types are one of its best parts.
Wow, and side-effects-tracking too! Amazing
I am curious whether some of these checks will be limited by JavaScript's dynamism. Part of why I'm doing mine as a new language is that JavaScript's semantics are just way too flexible to form some of the guarantees I feel like you need for some of this aggressive inference. But now I'm questioning that.
Either way, this is insanely impressive. Definitely not just yet-another-JavaScript-toolchian.
by simplify on 9/23/22, 8:06 PM
(This is something that's been possible for decades, but it never hit mainstream before as it's hard to implement it well enough to satisfy the silly preferences of us typical programmers :)).
by madeofpalk on 9/23/22, 4:24 PM
I would disagree this is a TypeScript compiler. It's a mostly-typescript-compatible compiler/type-checker.
The Typescript team iterate on it reasonably quickly. If you fall behind as the Typescript team adds new features, and you cannot check that code, is it still "Typescript"?
by nilsbunger on 9/23/22, 4:36 PM
by bcherny on 9/24/22, 2:28 AM
- Inferred generics that work
- Effect tracking
- Prepack-style AOT evaluation, but for typechecking
- JSX built in, with proper inference
- Using a typechecker to reduce the amount of work React needs to do (!!!)
- Using a typechecker to make SSR more efficient
- …
These are super interesting and very novel. I hope to see this open sourced soon —- curious if this kind of approach will work at scale.
by bin_bash on 9/23/22, 3:55 PM
by immigrantheart on 9/23/22, 4:30 PM
by fbn79 on 9/23/22, 3:55 PM
by juancampa on 9/23/22, 3:42 PM
by mrpf1ster on 9/23/22, 6:41 PM
by bryzaguy on 9/23/22, 5:13 PM
by zer0zzz on 9/23/22, 11:05 PM
by ghasemi on 9/24/22, 9:44 AM
by shanghaikid on 9/24/22, 1:37 AM
by z3t4 on 9/23/22, 11:15 PM
I think 90% of JS types can be inferred statically...
by nexxel on 9/23/22, 4:02 PM
by pwdisswordfish9 on 9/23/22, 10:11 PM
This sentence is unreadable. The superfluous/incorrect use of parens for `.click()`, in combination with this page's style sheet and the way that paragraph wrapped in my browser are all things that didn't help, but eventually I was able to move past it. (It still doesn't make any sense, but I know that part isn't where the weirdness is.) Still unreadable. Bad for something pulled from a written work that's supposed to be a list of definitions you reference.