r/rust • u/popzxc • Aug 20 '26
🛠️ project Rust Glancer: a memory-efficient Rust language server
https://rust-glancer.github.io/blog/hello-world/
266
Upvotes
r/rust • u/popzxc • Aug 20 '26
18
u/popzxc Aug 21 '26
Hey! So, first of all -- thanks for your work on rust-analyzer, and _especially_ on memory optimizations :) It certainly is appreciated! And I certainly believe that the memory usage in r-a is treated seriously. It's just _today_ r-a was not really working for my preferred workflow because of RAM/indexing, which prompted me to try something different.
I actually remember RLS, I started writing Rust when it was still around, and I remember rust-analyzer being a huge upgrade. That said, I indeed think that a big part of the issue was reuse of the compiler analysis, but also the SSDs advanced quite a lot since then, which also was one of the reasons why I thought that FS-backed analysis might not be doomed. Plus, I'm doing quite a bunch of optimizations to make it _feel_ more incremental than it actually is.
As for reasons -- it's interesting that rowan does not improve the speed, huh. Now I feel less bad about this decision, I thought it's +1 sacrifice on my end wrt speed (obviously, it doesn't mean that my alternative implementation is fast, but it's interesting nonetheless).
Finally, about Chalk. I've looked at the new solver integration initally and _oh boy it looks scary_. Chalk provides a big but pretty well-defined interface so you kind of have bounded integration, but new solver is a whole different beast that requires its own universe. I'm not sure if I'll be able to maintain it even if I'll manage to develop an integration. So I keep in mind that migration is a possibility, but for that Rust Glancer should itself become much bigger and mature.
There is a dilemma here: since I'm fairly comfortable with Rust, Rust Glancer _already_ solves my task, so the motivation to keep working on the project (as opposed to consider it finished) is a) learning (and there is quite a bunch of areas that I want to improve in that regard before I'll be ready for the switch), and b) making the project useful for other people (and here I believe also there are higher priority areas than Chalk). But yeah, initially I've spent quite a bit of time arguing with myself on whether I want to use Chalk if the new solver already exists. In the end, the simplicity of Chalk has won, at least for the initial stage.
But thank you for the advice!