Urgent.News

What's breaking now, across thousands of outlets.

Tech

rust-glancer: An alternative LSP for Rust with focus on low memory usage

The source material details a project called "rust-glancer," an alternative implementation of the Rust Language Server (LSP) with a focus on low memory usage. The author has been working on this project for four months, and throughout the process, the RAM usage remained below 100MB even on an older MacBook Pro M1 2020 with 8GB of RAM.

However, rust-glancer is still an incomplete project, with many missing features, known bugs, and room for improvement. Despite its limitations, the author claims that rust-glancer is still capable, offering essential functionalities such as full indexing, type inference, trait solving, and common LSP actions like goto definition, hover, inlay hints, and completions.

The project was motivated by the high memory consumption of rust-analyzer, particularly due to its architecture, which prioritizes speed over memory efficiency. The author proposes a different approach: maintaining a frozen analysis result stored in the filesystem, which can be loaded and queried as needed. This approach, while slower than rust-analyzer's incremental analysis, allows for reduced memory usage.

Rust Glancer implements various optimizations to mitigate the slower indexing process, such as shallow analysis during typing and reusing previous complete indexes. Although this approach has some drawbacks, like delayed indexing and potential inaccuracy with agent-driven changes, the author believes it offers a viable alternative for users with lower-end machines or those willing to sacrifice some completeness for reduced RAM usage.

The author, with over seven years of professional Rust experience, initially considered building a simplified Rust LSP. However, he quickly realized the complexity of such a task and decided to proceed with rust-glancer instead. While the project is not intended to surpass rust-analyzer in terms of completeness and keystroke accuracy, it aims to cater to users with weaker machines or those seeking to reduce memory consumption.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at rust-glancer.github.io →

More in Tech

Tencent EdgeOne Makers: Pengalaman Deploy Project Web Gratis

Di era digital saat ini, kebutuhan akan layanan hosting yang cepat, aman, dan mudah digunakan semakin meningkat. Baik bagi developer pemula maupun profesional, proses deploy aplikasi sering kali…

  • Tencent EdgeOne Makers provides fast, secure, and easy-to-use hosting for developers.
  • Program offers modern features to enhance website performance, security, and availability.
  • Deployment process for static websites is quick, with good response and stable access.

More from Friday 21 August →