TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rust Moving Towards an IDE-Friendly Compiler with Rust Analyzer

235 pointsby sethevover 5 years ago

7 comments

_bxg1over 5 years ago
&gt; Another thing is difference in handling invalid code. A traditional compiler front-end is usually organized as a progression of phases, where each phase takes an unstructured input, checks the input for validity, and, if it is indeed valid, adds more structure on top. Specifically, an error in an early phase (like parsing) usually means that the latter phase (like type checking) is not run for this bit of code at all. In other words, &quot;correct code&quot; is a happy case, and everything else can be treated as an error condition. In contrast, in IDE code is always broken, because the user constantly modifies it. As soon as the code is valid, the job of IDE ends and the job of the batch compiler begins. So, an IDE-oriented compiler should accommodate an incomplete and broken code, and provide IDE features, like completion, for such code.<p>This has been one of the most frustrating things about Rust&#x27;s development experience. A piece of code looks error-free, then you fix an error somewhere else, reach the next compiler phase, and an error pops up where you just were. It makes it really hard to develop something piece by piece.<p>I&#x27;m glad they&#x27;re aware of these problems and are making a concerted effort to address them.
评论 #22214392 未加载
评论 #22214264 未加载
评论 #22215235 未加载
dunkelheitover 5 years ago
Aleksey is true to his “avoid success at all cost” strategy, constantly emphasizing that rust-analyzer is experimental and alpha quality. Even the installation process is I think deliberately clunky. In fact in my opinion it already provides a better IDE experience than RLS and is improving daily, whereas RLS is stuck in maintenance mode.
评论 #22214380 未加载
评论 #22217758 未加载
评论 #22217896 未加载
ricticover 5 years ago
What would a compiler for a language like Rust or C++ look like if it was optimized for development iteration speed first? Could you produce binaries that were good enough to be useful for testing and developing?<p>You&#x27;d end up sharing a lot of the same infrastructure that you&#x27;d want for an LSP server, basically to do as much preprocessing as you could on the initial compilation and then work incrementally on top of that.<p>You&#x27;d also of course still want your globally-optimizing batch mode compiler for production, but for many projects it seems like such a thing could produce good enough binaries for development, and greatly improve engineer productivity.
评论 #22216243 未加载
评论 #22215520 未加载
评论 #22214736 未加载
评论 #22214739 未加载
评论 #22215787 未加载
评论 #22216359 未加载
评论 #22215305 未加载
评论 #22214713 未加载
评论 #22215238 未加载
评论 #22214683 未加载
xiphias2over 5 years ago
It would be great to have a timeline as well: when does the project plans to superseed the current RLS? What&#x27;s the goal for end of 2020?<p>At the same time I know how hard is to estimate projects.
评论 #22216616 未加载
unnouinceputover 5 years ago
Quote: &quot;The main thing is that the command line (or batch) compiler is primarily optimized for throughput (compiling N thousands lines of code per second), while an IDE compiler is optimized for latency (showing correct completion variants in M milliseconds after user typed new fragment of code)&quot;<p>And then there&#x27;s Delphi, doing both.
评论 #22219179 未加载
Dowwieover 5 years ago
I am so grateful for the effort that people are putting into the rust-analyzer project. It keeps getting better. I wonder whether an entire class of challenges that the project faces is attributed to electron?
评论 #22216612 未加载
评论 #22219114 未加载
评论 #22217902 未加载
CameronNemoover 5 years ago
I have been using racer and neomake with a lot of success, fwiw.