For the last few months, @nikomatsakis, @wycats, and myself have been working on an experimental compiler to see if we can build one that can handle both straight-line/traditional compilation as well as be able to be used in an interactive environment like an IDE. Still very early days, but it’s showing some promise and we wanted to chat about the project with the wider compiler team.
The project is built on Salsa, with each stage (parsing, typechecking, etc) being salsa-ified. This lets us create a lot of queries that can answer specific questions about entities in the system, like typechecking a single function or grabbing the header of a function without its body.
To prove things out, we also built Language Server Protocol (LSP) support into the compiler, so you can run the compiler in IDE mode from inside VS Code and get interactive features.
If you’re interested, there’s a link to learn more:
- For more in-depth overview: https://github.com/lark-exploration/lark/blob/master/docs/internals.md
- Video covering some of the basics: https://www.youtube.com/watch?v=SGY3TZMkOpo&feature=youtu.be
As I mentioned, it’s still very early days, but we’re hoping to prove out enough to show that the approach could potentially work for Rust itself.