Ezno: a new TypeScript compiler

bpierre
189
50
6d
KALEIDAWAVE.GITHUB.IO

Comments

fbn79 6d
Remind me of Hegel (https://hegel.js.org/) but with typescript compatibility. It's a pity Hegel develompent stopped because war in Ukraine (https://github.com/JSMonk/hegel/issues/363)
bin_bash 6d
anyone else think it's really strange this is "Ezno" and not "Enzo"?
juancampa 6d
On a related note: Is there anyone working on a faster tsc? I know there's esbuild and swc, but those only transpile, they don't type-check.
brundolf 6d
> One of the key ideas with Ezno is that it attempts "maximum" knowledge of a source

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.

nilsbunger 6d
What I'd really like is a tsc that creates code to check types at runtime, like for API boundaries and parsing unknown input. Kind of like a built-in Zod. Maybe it's just an automatic type guard anywhere you have an "as SomeType" or an ignore directive.
madeofpalk 6d
> Ezno's type checker is built from scratch. Getting the features I wanted requires a lot of different functionality and needed several new ideas that as far as I know aren't present in any type-system or existing checkers.

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"?

immigrantheart 6d
All of these compiler/transpiler related projects, especially for big mainstream language like TypeScript seems like a full time job, more so than any other open source initiatives. You need to keep up with the spec, constantly read the source codes, etc. Kudos to those who are providing their time to do this.
nexxel 6d
Looks really cool!
bryzaguy 6d
Wow! Amazing! Am I reading correctly that Ezno is aiming to render React obsolete?
mrpf1ster 6d
This looks incredible, looking forward to an official release to play around with!
simplify 6d
As a programming language geek, TypeScript is one of the best things to ever happen to the industry. It's finally dispelled the notion that "types == Java == bad/annoying", and shown how powerful and convenient a type system can actually be.

(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 :)).