Rust Glancer: a memory-frugal alternative LSP targeting under 100MB
A developer with roughly seven years of Rust experience has spent four months building Rust Glancer, an alternative language server that trades rust-analyzer’s incremental speed for drastically lower memory use — aiming to stay under 100MB on reasonable projects, versus the many gigabytes rust-analyzer can consume. The core design bet is to abandon incremental analysis entirely: instead of keeping a lazily-computed, salsa-backed query database resident in RAM, Rust Glancer indexes the workspace once, freezes the result, and offloads it to the filesystem, loading only what a given query needs. Because the index lives on disk, it also survives editor restarts without re-indexing. The author blames rust-analyzer’s memory footprint partly on unavoidable workspace complexity, but mostly on architectural choices — salsa’s memory-bound incremental model and rowan’s syntax trees, which fragment memory.
The approach has real costs. Deserializing from disk is slower than reading memory, so to keep typing responsive Rust Glancer does only shallow analysis of the current function on each keystroke and reuses the last full index — meaning new imports, structs, and traits aren’t picked up until you save. It also adds a custom file watcher and deprioritizes out-of-editor edits, which the author says keeps inlay hints stable under AI agent workflows where rust-analyzer tends to misplace them. The server already handles a full indexing pipeline with type inference and the chalk trait solver, plus common LSP actions like goto-definition, hover, completions, and inlay hints, and ships as a VS Code extension.
The piece is candid about scope: four months is nowhere near enough to match rust-analyzer’s completeness, and the author expects it never will — positioning Rust Glancer as a tool for weaker machines or users willing to accept save-time indexing rather than a drop-in replacement. The origin story is a familiar case of scope creep: what began as a ‘smart ctags for Rust’ kept accreting body lowering, type propagation, and naive trait resolution until it became a real LSP, with the illusion of simplicity breaking the moment iterator-heavy generic code needed to type-check correctly.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.