Rust Glancer: Memory-Efficient Rust LSP Alternative
A new language server for Rust developers prioritizing low RAM usage
1Core Project Goal
Rust Glancer was developed to address the high RAM consumption of rust-analyzer. It specifically targets older machines like 8GB MacBook Pros, demonstrating under 100MB memory usage in tests - 100x more efficient than rust-analyzer's typical 16GB consumption. The project maintains full LSP functionality while dramatically reducing resource requirements.
2Current Features
Rust Glancer currently supports basic LSP features: go-to-definition, hover information, inlay hints, and completions. It includes a full indexing pipeline with type inference and trait solving (chalk). While supporting most standard Rust syntax, it's not yet a complete LSP solution and contains some known bugs and missing functionality.
3Technical Approach
Unlike traditional LSPs, Rust Glancer performs one-time workspace indexing instead of incremental analysis, storing results in the filesystem to minimize memory usage. During typing, it performs shallow analysis on the current function only, delaying full indexing until save. This design prioritizes memory efficiency over real-time responsiveness.
4Performance Optimizations
While filesystem-based analysis is inherently slower, Rust Glancer implements several optimizations. Its custom file watcher resolves synchronization issues with external changes (like CI/CD or AI assistants). It also employs low-priority reindexing for external modifications, preventing performance degradation during automated workflows.
5Installation and Usage
Users can install the VS Code extension from the marketplace or build the vsix package manually from GitHub. The open-source project welcomes community contributions. It's particularly suitable for developers working on low-spec machines or large workspaces where memory constraints are problematic.
6Comparison with rust-analyzer
While rust-analyzer focuses on completeness and keystroke accuracy, Rust Glancer prioritizes memory efficiency. It shows significantly faster initial indexing for projects with proc macros and build scripts. However, it currently lacks support for some advanced features and nightly Rust capabilities.
7Development Process
The project was created over 4 months by a developer with 7 years of Rust experience. Initially conceived as 'smart ctags', it gradually evolved into a full LSP alternative. Leveraging rust-analyzer's syntax library initially, it developed its own optimizations over time.
8Use Cases
Rust Glancer excels in two scenarios: 1) Developers working with multiple IDE windows (where memory consumption scales linearly), and 2) Teams handling large workspaces with multiple projects. It also offers advantages in CI/CD pipelines due to its low resource requirements.
9Future Plans
The developer plans to address missing features and bug fixes, but explicitly states Rust Glancer will never aim for full rust-analyzer feature parity. Long-term goals include solidifying its position as a 'lightweight alternative' and improving usability on portable devices with limited resources.
10Community Impact
Rust Glancer fills an important gap in the Rust ecosystem, improving accessibility for developers in resource-constrained environments and educational institutions. The project has sparked new discussions about performance-feature tradeoffs and encourages alternative tool development within the community.
Original article: Hacker News — Rust Glancer: Hafıza Dostu Rust LSP Alternatifi