logoalt Hacker News

armchairhackerlast Sunday at 1:31 PM3 repliesview on HN

> In Zig, every file can be parsed completely in isolation...every name needs to be explicitly declared (there’s no use *)...

> In contrast, you can’t really parse a file in Rust...Expanding macros requires name resolution, which, in Rust, is a crate-wide, rather than a file-wide operation...Similarly, the nature of the trait system is such that impl blocks relevant to a particular method call can be found almost anywhere...

matklad doesn't even mention dynamic languages, where perfect name resolution is undecidable. "Fast static analysis, easy static analysis, language designed for static analysis - pick two".

Rust's IDE integration is fast and deep, and I've heard TypeScript's is too, so "easy static analysis" may not be important today. I believe it will as coding evolves due to LLMs, albeit without evidence and I'm not quite sure how.


Replies

rendawtoday at 2:53 AM

> "Fast static analysis, easy static analysis, language designed for static analysis - pick two"

Where does this come from and what's the explanation?

show 1 reply
foolswisdomtoday at 1:30 AM

I would really appreciate if rust analyzer was faster, actually. It feels even worse with the fact that you need to save the file before it updates the type checking (though I assume it's because it's too slow to feel smooth if you do it while typing?).

show 1 reply