Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@matklad
Last active August 30, 2019 17:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matklad/2d5f89a394cc70da97e5282fd6d88ef2 to your computer and use it in GitHub Desktop.
Save matklad/2d5f89a394cc70da97e5282fd6d88ef2 to your computer and use it in GitHub Desktop.
rustc-ide-proposal.md

Title: rustc IDE

Estimate: 1 or 2 meeting

Type: technical

Summary

Figure out further steps to make rustc a perfect-for-ides compiler, based on experience with rust-analyzer so far.

Motivation

At the latest Rust all-hands we've figured out that we probably want to do a significant re-engeneering of compiler internals to make it a good IDE backend. The first step was to experiment with alternative compiler architecture, based on the rust-analyzer project. The experiment so far is pretty successful, so it's time to move forward, beyond the experimental state, so that we avoid the problem of two parallel compilers.

Details

I don't know the specific actions should we take, but the general theme seems to be clear: we want to split rustc into more or less independent libraries, making sure that each new library is usable both from the current rustc-architecture, and from the hypothetical IDE-first architecture of the future.

Some specific promising areas for librarification are:

  • trait solving (chalk): this work is already in progress. What are the blockers for finishing this work?
  • parsing: we already extracted the lexer bit into a stand alone library, could we do the same with the parser?
  • type checking: another bit of the compiler that seems relatively self-contained.
  • name resolution & macro expansion: this bit seems pretty entangled with the current AST data structure, but, at the same time, it's the most valuable to extract, as it impacts the IDE experience the most.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment