<aside> 💡

Incremental computation means reusing whatever parts of the previous run are still valid. Doing that purely in memory is fairly well understood; Salsa and rust-analyzer are the standard examples. The hard part is putting the dependency graph and results on disk so the reuse survives a process restart. That takes three things: (1) "stable IDs" that mean the same thing across sessions, (2) comparing "fingerprints" instead of the values themselves, and (3) a design that treats the cache as something you can throw away when it's broken.

</aside>

Why this, why now

On 2026-11-19, "Persistent incrementality in Rust" picked up discussion on Lobsters. The post is dated 11-06 and comes from the author of Rust Glancer, a lightweight Rust language server. In short:

The same problem is surfacing in other places at the same time:

So the open question isn't whether incremental computation pays off. It's how to make incremental state outlive the process. That design question applies whether you're writing a language server, a compiler, or a bundler.

The problem

Take the post's toy example. word_count(file) counts the words in a file, and files can include other files. is_haha_number(file) returns true if that count is 67, 69, or 420.

A naive implementation recounts everything whenever any file changes. Incremental computation wants three things:

  1. Redo only what depends on changed inputs. Editing an unrelated file c shouldn't touch a's result.
  2. If a recomputed result equals the old one, stop propagating (early cutoff). If b's word count goes from 67 to 69, is_haha_number(a) is still true, so nothing downstream should rerun.
  3. Follow changes to the dependencies themselves. If a's include switches from b to c, a no longer depends on b.

In memory, these three are solved fairly cleanly. Once you close and reopen the editor, or run cargo build as a separate process, several new problems appear at once: