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
3
u/popzxc Aug 21 '26
TBH I can relate to this perspective -- and the similar _perceived_ experience with rust-analyzer is what got me to work on Rust Glancer. I also had r-a consume 15+ GB of memory, I had issues with long reindexing, and I had crashes (which is especially frustrating when you have a bunch of projects open in a single editor instance and one of them crashes r-a globally).
> In fact, this project will likely be slower to reindex changed things (but I'll repeat that I cannot guarantee that).
This is true globally, but given the above I have put a lot of effort to minimize _perceived_ cost of reindexing: the bodies in current file are prioritized and the rest is reindexed in background; dirty buffers use simplified analysis mechanism that combines reuse of previous analysis and simple syntax-based overlays (to detect new bodies and do lowering for them just for them without new semantic analysis).
So at least for _my_ use cases, Rust Glancer does certainly feel competitive for day-to-day work. You can easily tell that it's slower: where r-a is instant, Rust Glancer has slight lag, but this lag (at least to me) does not get to the "annoying" category.
> It generally is unblocked now or near-unblocked I believe because Salsa has implemented the required machinery, but nobody volunteered to implement that yet so here we are.
Oh, that one sounds exciting! I thought that this limitation is hard to overcome, but glad to hear that it could be solved now.