12 ms·
Show HN: Ezno, a type checker for JavaScript and optimiser for React
- juancampa 4y agoOn 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.
- martpie 4y agoRome (written in Rust) is trying to be a faster tsc (amongst other things, like a faster webpack, babel, prettier, etc) https://rome.tools/#development-status https://rome.tools/#development-status
- deleted 4y ago[deleted]
- e1g 4y agoRome’s journey is effectively over - the founders couldn’t make it work after raising a VC round, and I wouldn’t expect it to go GA.
- jquery_dev 4y agoWhat do you mean by "make it work"? They've raised 4.5M last year, did they just burn through that?
- lazlo_kovacs 4y agoIt appears from their repo that they have 5-6 people working full time on this. Assuming about 250k per developer that puts their burn at 6 * 250k = 1.5 million a year. So yeah they have some time. Although I would be severely concerned at their progress considering it’s already been a year and they don’t seem to have shipped much. No proof of PMF or any sort of revenue with over a third of their runway depleted should have them hustling to get on the boards.
- dsmmcken 4y agoThe repo still looks pretty active, which seems contrary to your statement.
- e1g 4y agoIf you're looking for evidence in the public repo, consider what's not in there: one co-founder is missing, and so are the commits from the other author/co-founder for over a year. Not the signals you want in a dev-tooling project.
- pohl 4y agoOr you could look to see if new work is being released. Most recent one was just 17 days ago. https://twitter.com/rometools/status/1567169157891776514 https://twitter.com/rometools/status/1567169157891776514
- lazlo_kovacs 4y agoExcept how many users do they have? If I were a VC fund looking to give them another round, I’d want to know their metrics, whether that’s users, downloads, or revenue. Judging by their blog, it’s been a year since they raised the money. Have they produced anything other than a bunch of code? Because code isn’t worth much without users.
- ricardobeat 4y agoI found it interesting that a good chunk of outside contributions[1] happened before funding, and have almost completely stopped. [1] https://github.com/rome/tools/graphs/contributors https://github.com/rome/tools/graphs/contributors
- kidfiji 4y agoYep! The person who started swc is doing just that: https://kdy1.dev/posts/2022/1/tsc-go https://kdy1.dev/posts/2022/1/tsc-go
- zamalek 4y agoWe also need a faster language server. Inference (e.g.[1]) is one of the greatest features of TS, but we're told not to use it. [1]: https://trpc.io/ https://trpc.io/
- psnehanshu 4y agoI absolutely love tRPC.
- Vinnl 4y agoIt was just an experiment, but this person was (and is still doing related stuff): https://twitter.com/MarcJSchmidt/status/1551961839394865152 https://twitter.com/MarcJSchmidt/status/1551961839394865152 (and an example: https://twitter.com/MarcJSchmidt/status/1552781654065905664 https://twitter.com/MarcJSchmidt/status/1552781654065905664)
- WorldMaker 4y agoBased on the release notes, the Typescript team is working on faster type-checking as continuous goal and has many big long-term irons in that fire. Though a lot of the more recent work has gotten into the performance of projects already scaled into project references and incremental builds, so it may not yet be obvious how much work has gone into performance if you consider your projects small/medium-sized. It can sometimes be quite an effort to refactor a medium sized project into project references with incremental builds and there's currently no obvious moment where Typescript knows to tell you "you've got a 'large' project now, if you split this workspace into multiple tsconfig projects that smartly reference each other and switched to incremental build flags you'd get a bunch of performance improvements". So that's still a matter of figuring it out for your own projects if you can take advantage of that (and how you would take advantage of that).
- fbn79 4y agoRemind me of Hegel (https://hegel.js.org/ 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 https://github.com/JSMonk/hegel/issues/363). Looks really cool but in my opinion would better to concetrate on type checking living other things (vdom, ssr) out or in optional plugins
- Vinnl 4y agoAs far as I can see they are living in optional plugins (tentatively called "framework"), if I understand the post correctly.
- fbn79 4y agoYou r right. I missed that point. Cool
- lacasito25 4y agoIt's done in js, so it will eventually have the same performance problems as typescript has. What a shame
- bin_bash 4y agoanyone else think it's really strange this is "Ezno" and not "Enzo"?
- barnabask 4y agoI didn’t realize it wasn’t Enzo until reading your comment just now, and that’s after skimming the article for several minutes. Now I’m wondering if I’m dyslexic or what.
- user3939382 4y agoIt's just a side effect of how we read https://i.imgur.com/o5zL6Rh.png https://i.imgur.com/o5zL6Rh.png
- psnehanshu 4y agoWow, I was assuming it to be Enzo until I saw this comment.
- deleted 4y ago[deleted]
- nexxel 4y agoLooks really cool!
- madeofpalk 4y ago> 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"?
- anamexis 4y agoThe author himself does not call it a TypeScript compiler.
- madeofpalk 4y agoThat is actually completely fair - I still had OP's editorialized headline in mind when reading the site, and didn't notice all it says about typescript is "The checker is fully compatible with TypeScript type annotations" which is probably fair!
- yencabulator 4y agoThe author states > The checker is fully compatible with TypeScript type annotations and can work without any type annotations at all. That should at least be guarded with a version number, then.
- brundolf 4y ago> 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.
- julesnp 4y agoThe automatic generics look at lot like how OCaml implements inference for structural typing.
- the_duke 4y agoAs the sibling comment mentioned, both Ocaml and Haskell use this kind of type inference. Search for Hindley Milliner type system.
- wk_end 4y agoThis is far beyond Hindley-Milner (as are Ocaml and Haskell), which is pretty primitive in-and-of-itself.
- fuzzythinker 4y agoLinks for those wondering: Blog: https://www.brandons.me/tags/bagel.html https://www.brandons.me/tags/bagel.html HN (53 comments, 1 yr ago): https://news.ycombinator.com/item?id=28566597 https://news.ycombinator.com/item?id=28566597 gh: https://github.com/brundonsmith/bagel https://github.com/brundonsmith/bagel
- immigrantheart 4y agoAll 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.
- nilsbunger 4y agoWhat 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.
- brundolf 4y agoMy TypeScript-like language (still a work in progress) does that :) https://www.brandons.me/blog/bagel-bites-refinement https://www.brandons.me/blog/bagel-bites-refinement
- hutzlibu 4y agoMine, too. (also work in progress, but not published) I wonder how many of us there are ...
- eagsalazar2 4y agoThis x1000! Type guards are a joke and real runtime type checking could be so easy if they prioritized it. Yes you can use zod but then you have to define your types through zod which isn't as neat. I actually googled for this just yesterday!
- jitl 4y agoI’m working on a code generator that converts Typescript types to other schema descriptions. One of the conversions is TS -> TypeBox/JSONSchema: https://github.com/justjake/ts-simple-type/blob/main/src/compile-to/json-schema.ts https://github.com/justjake/ts-simple-type/blob/main/src/com...
- phpnode 4y agoMarc J Schmidt has been working on this for typescript at https://deepkit.io/ https://deepkit.io/ and it looks very impressive, and ambitious. I made something similar for Flow a long time ago: https://gajus.github.io/flow-runtime/#/try https://gajus.github.io/flow-runtime/#/try
- bryzaguy 4y agoWow! Amazing! Am I reading correctly that Ezno is aiming to render React obsolete?
- eyelidlessness 4y agoMy understanding reading it is that it’s implementing something more like SolidJS (which is also a no-VDOM reactive library which looks a lot like React) and Qwik (which also serializes/resumes from state in the DOM), but built into the core compiler rather than as a separate library/JSX transform. I doubt it’ll make React obsolete, especially as React expands in scope (e.g. Server Components), but it might be a good replacement for a lot of use cases. It’s certainly got my attention!
- kaleidawave 4y agoNo defiantly not an intention to render anything obsolete. I think React will be around for a while. Instead if you like stricter types, `.map`, and `.push` JSX and want to reduce the runtime abstraction by moving it to compile time then it offers a possible alternative to React. Haven't gone into too much yet but there is a probably a lot of React applications that are too complicated for the optimiser to work :( and there it won't be an alternative. Lots of great alternatives to React these days as well which I also want to promote!
- AmalgatedAmoeba 4y agoLooks very promising! My understanding is that Svelte has a similar approach. Would be amazing to have an alternative using just JSX.
- mrpf1ster 4y agoThis looks incredible, looking forward to an official release to play around with!
- z3t4 4y agoSo how do I use this ? I think 90% of JS types can be inferred statically...
- deleted 4y ago[deleted]
- simplify 4y agoAs 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 :)).
- mhh__ 4y ago> industry. It's finally dispelled the notion that "types == Java == bad/annoying", Where is this industry and how do I avoid it?
- deleted 4y ago[deleted]
- zdragnar 4y agoAnywhere in non-enterprise web development in the heyday of Ruby/ python / php. Static typing fell out of favor hard among certain crowds. Typescript brought many of them back to the world of static typing, and all three of the aforementioned languages are getting more static support, so it isn't nearly so prevalent as say 10 or 15 years ago.
- the_duke 4y agoTypescript has a decent type system, but it is really held back by being "just" a type checker for JS, with all the JS semantics. The way sum types are done in TS is really awkward. The type system is unsound. What's worse is that you never have a guarantee that the types are actually correct at runtime, due to bad third party typings, compiler limitations, use of any, ... It's still a lot better than using plain JS, and a lot of the limitations aren't by choice, but come from the need to compile down to and remain compatible with plain JS. It just could be so much better.
- enlyth 4y agoI wish Microsoft would make a language almost exactly like Typescript, but where code has to be strictly typed (no any, unknown, etc.) and it would compile to a normal binary, with some sort of GC, for multiple platforms. It would hit the sweet spot for me, I know Rust is popular these days, but it seems like it's made for type astronauts, and sometimes I just want to write some code and get things done quickly and don't care about squeezing out every last drop of bare metal performance or abstracting seven layers of types to please a borrow checker.
- pwdisswordfish9 4y ago> VDOM is a virtual representation of the document, actual DOM references the document (e.g. .click() isn't on VDOM structures). 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.
- pwdisswordfish9 4y agoI'll double down and reiterate. This "sentence" is unparseable nonsense. It reads like a half-finished grammatical nightmare.
- zer0zzz 4y agoNo one’s looking at Static Hermes? https://github.com/facebook/hermes/commits/static_h https://github.com/facebook/hermes/commits/static_h
- gorbypark 4y agoI’m aware of what Hermes is, but what’s Static Hermes?
- shanghaikid 4y agoTypescript is great, for team collaboration, code refactor, etc, but I don't think every project should use it, sometimes javascript is much easier and faster to implement.
- bcherny 4y agoWow, this is seriously impressive work, if it really works as well as the code examples make it seem. Many of these ideas I have not seen in other JS typecheckers: - 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.
- ghasemi 4y agoEzno is a city in Iran :D