News for hackers. Stuff that matters.
Re:Incremental Compilation by Raphael_Amiard on Friday September 09, 2016 @06:59AM (#12461001)
Great blog post ! One thing I wonder as a compiler head though is, what is the granularity of this stuff ? Is it per-file or per-function, or even per block ? If it's finer than per file, how do you do the tree diff ? Do you parse whole files and then do a node-by-node diff ? Do you have an incremental parser ?

If I was to implement incremental compilation, I'd start with per-module I guess, because it's the atomic unit for a compiler, so it would be a lot simpler. That's why I'm curious.

Re:Incremental Compilation by finnyspade on Friday September 09, 2016 @08:36AM (#12461545)
I can actually help you out on this one. I spent the summer hacking on the Rust compiler for my internship. If I'm understanding the code correctly, this is the enum of elements represented in the dependency graph.

https://manishearth.github.io/rust-internals-docs/rustc/dep_...

Note that as per:

https://manishearth.github.io/rust-internals-docs/rustc/dep_...

The DepGraph that we actually care about is specialized to talk about DefIds. In rustc, DefIds are attached to the following things:

https://manishearth.github.io/rust-internals-docs/rustc/hir/...

This means dependencies are analyzed down to local variables and uses. But even beyond that it tracks things such as borrow checks, linting and more!