TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Ezno, a type checker for JavaScript and optimiser for React

175 点作者 kaleidawave超过 2 年前

17 条评论

brundolf超过 2 年前
&gt; One of the key ideas with Ezno is that it attempts &quot;maximum&quot; knowledge of a source<p>I&#x27;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&#x27;m jealous of (inspired by? :)) some of the crazier stuff going on here, like usage-based argument types and tracing not just value <i>shapes</i> but value <i>reference identities</i><p>The &quot;automatic generics&quot; feature in particular is absolutely bonkers. It never even occurred to me that you could do that. I&#x27;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.<p>Wow, and side-effects-tracking too! Amazing<p>I am curious whether some of these checks will be limited by JavaScript&#x27;s dynamism. Part of why I&#x27;m doing mine as a new language is that JavaScript&#x27;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&#x27;m questioning that.<p>Either way, this is insanely impressive. Definitely not just yet-another-JavaScript-toolchian.
评论 #32960997 未加载
评论 #32958709 未加载
评论 #32959941 未加载
评论 #32956276 未加载
评论 #32955749 未加载
simplify超过 2 年前
As a programming language geek, TypeScript is one of the best things to ever happen to the industry. It&#x27;s finally dispelled the notion that &quot;types == Java == bad&#x2F;annoying&quot;, and shown how powerful and convenient a type system can actually be.<p>(This is something that&#x27;s been possible for decades, but it never hit mainstream before as it&#x27;s hard to implement it well enough to satisfy the silly preferences of us typical programmers :)).
评论 #32956575 未加载
评论 #32956544 未加载
madeofpalk超过 2 年前
&gt; Ezno&#x27;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&#x27;t present in any type-system or existing checkers.<p>I would disagree this is a <i>TypeScript</i> compiler. It&#x27;s a mostly-typescript-compatible compiler&#x2F;type-checker.<p>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 &quot;Typescript&quot;?
评论 #32954019 未加载
nilsbunger超过 2 年前
What I&#x27;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&#x27;s just an automatic type guard anywhere you have an &quot;as SomeType&quot; or an ignore directive.
评论 #32954605 未加载
评论 #32954818 未加载
评论 #32955199 未加载
评论 #32955185 未加载
评论 #32954205 未加载
评论 #32958189 未加载
评论 #32954240 未加载
bcherny超过 2 年前
Wow, 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:<p>- Inferred generics that work<p>- Effect tracking<p>- Prepack-style AOT evaluation, but for typechecking<p>- JSX built in, with proper inference<p>- Using a typechecker to reduce the amount of work React needs to do (!!!)<p>- Using a typechecker to make SSR more efficient<p>- …<p>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.
bin_bash超过 2 年前
anyone else think it&#x27;s really strange this is &quot;Ezno&quot; and not &quot;Enzo&quot;?
评论 #32953909 未加载
评论 #32958196 未加载
immigrantheart超过 2 年前
All of these compiler&#x2F;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.
fbn79超过 2 年前
Remind me of Hegel (<a href="https:&#x2F;&#x2F;hegel.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hegel.js.org&#x2F;</a>) but with typescript compatibility. It&#x27;s a pity Hegel develompent stopped because war in Ukraine (<a href="https:&#x2F;&#x2F;github.com&#x2F;JSMonk&#x2F;hegel&#x2F;issues&#x2F;363" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JSMonk&#x2F;hegel&#x2F;issues&#x2F;363</a>). Looks really cool but in my opinion would better to concetrate on type checking living other things (vdom, ssr) out or in optional plugins
评论 #32953883 未加载
评论 #32961174 未加载
juancampa超过 2 年前
On a related note: Is there anyone working on a faster tsc? I know there&#x27;s esbuild and swc, but those only transpile, they don&#x27;t type-check.
评论 #32953535 未加载
评论 #32953488 未加载
评论 #32953809 未加载
评论 #32956759 未加载
评论 #32953526 未加载
mrpf1ster超过 2 年前
This looks incredible, looking forward to an official release to play around with!
bryzaguy超过 2 年前
Wow! Amazing! Am I reading correctly that Ezno is aiming to render React obsolete?
评论 #32955720 未加载
评论 #32961079 未加载
zer0zzz超过 2 年前
No one’s looking at Static Hermes?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;hermes&#x2F;commits&#x2F;static_h" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;hermes&#x2F;commits&#x2F;static_h</a>
评论 #32960534 未加载
ghasemi超过 2 年前
Ezno is a city in Iran :D
shanghaikid超过 2 年前
Typescript is great, for team collaboration, code refactor, etc, but I don&#x27;t think every project should use it, sometimes javascript is much easier and faster to implement.
z3t4超过 2 年前
So how do I use this ?<p>I think 90% of JS types can be inferred statically...
nexxel超过 2 年前
Looks really cool!
pwdisswordfish9超过 2 年前
&gt; VDOM is a virtual representation of the document, actual DOM references the document (e.g. .click() isn&#x27;t on VDOM structures).<p>This sentence is unreadable. The superfluous&#x2F;incorrect use of parens for `.click()`, in combination with this page&#x27;s style sheet and the way that paragraph wrapped in my browser are all things that didn&#x27;t help, but eventually I was able to move past it. (It still doesn&#x27;t make any sense, but I know that part isn&#x27;t where the weirdness is.) Still unreadable. Bad for something pulled from a written work that&#x27;s supposed to be a list of definitions you reference.
评论 #32975874 未加载