Get the latest tech news
Rust’s Incremental Compiler Architecture
The traditional structure of a compiler forms a pipeline — parsing, type-checking, optimization, and code-generation, usually in that order. But modern programming languages have requirements that are ill-suited to such a design.
Build systems, while not always perfect, usually do a good job of tracking the dependencies between components and correctly caching partial results. The process of figuring out whether an intermediate result has changed is complicated by the fact that any information about the incremental build needs to be shared between runs of the compiler by saving it to disk. In order to avoid the overhead of deserializing intermediate results to detect changes, the compiler calculates and stores hashes for each item.
Or read this on Hacker News