HN
Today

Rust Glancer: Rust LSP using 100x less RAM

A new Rust Language Server Protocol (LSP) implementation, Rust Glancer, emerges with a focus on dramatically lower memory usage, often under 100MB, and quicker editor restarts. It tackles the perennial pain point of rust-analyzer's RAM hunger by trading incremental updates for persistent, file-system-backed analysis. HN is abuzz with relief and curiosity, particularly from developers struggling with large Rust workspaces on less powerful machines.

18
Score
11
Comments
#1
Highest Rank
22h
on Front Page
First Seen
Aug 22, 1:00 AM
Last Seen
Aug 22, 10:00 PM
Rank Over Time
6443562111445788101330272725

The Lowdown

Rust Glancer is a novel Language Server Protocol (LSP) implementation for Rust, developed over four months with the primary goal of significantly reducing memory consumption compared to the widely used rust-analyzer. The author, a seasoned Rust developer, created it out of personal frustration with rust-analyzer's high memory footprint, especially in multi-workspace scenarios.

  • Core Innovation: Unlike rust-analyzer's incremental, in-memory approach, Rust Glancer uses a "frozen analysis" model. It indexes the workspace once and stores the results on the filesystem, loading data only when needed.
  • Memory Efficiency: The project targets memory usage below 100MB for reasonable projects, making it suitable for older or less powerful machines.
  • Fast Restarts: By persisting analysis results to disk, Rust Glancer eliminates the need for full re-indexing after an editor restart, improving startup times.
  • Trade-offs: This approach means analysis might be slower than rust-analyzer's incremental updates, and new items (like imports) aren't indexed until the file is saved. The project is also less feature-complete than rust-analyzer currently.
  • LLM Integration: The author openly discusses extensive use of Large Language Models (LLMs) in the development process, emphasizing their role as an acceleration tool while maintaining personal oversight and learning.
  • Future Plans: The roadmap includes further performance and memory optimizations, improved type inference, code actions, and potential novel approaches to proc macro support.

Rust Glancer positions itself not as a direct replacement for rust-analyzer for all users, but as a compelling alternative for those prioritizing low memory usage and quick restarts, even if it means some compromises in real-time incremental analysis.

The Gossip

Acronym Acrimony

A common debate on HN resurfaced: whether to explain technical acronyms like 'LSP'. Some users argued that acronyms should always be spelled out for clarity, while others countered that for the expected audience of a Rust LSP project, 'LSP' is a commonly understood term. One commenter ironically suggested that perhaps those relying heavily on LLMs for code might be less familiar with standard dev tooling terms.

Rust-Analyzer's RAM Reality

Commenters quickly validated the author's motivation, sharing their own frustrations with `rust-analyzer`'s significant memory footprint and slow indexing times for large Rust workspaces. This pain point makes Rust Glancer's focus on memory efficiency particularly appealing to the community.

LLM's Labyrinthine Labor

The author's candid disclosure about extensive LLM usage in the project's development sparked discussion. While the author clarified he maintained full oversight and learned through the process, commenters questioned the implications for code quality and understanding if LLMs are generating significant portions of code.

Matklad's Modest Mention

The user 'matklad' (a prominent figure in Rust tooling, notably `rust-analyzer`) posted a comment clarifying that *he* was not the author of Rust Glancer, but rather the link he provided was to *his* personal thoughts on the project. This led to a moderator's decision to merge related discussions.