March 2, 2026
Hashing out a hot compile fight
Against Query Based Compilers
Dev world erupts: Zig wants simple speed, Rust shouts macro magic
TLDR: The article argues query-based compilers aren’t a cure-all and hit limits when small edits trigger big changes. Comments explode into Zig simplicity vs Rust macro power, with one camp calling the encryption example flawed and others pushing hybrid “diff + queries” and stricter import habits to keep builds snappy.
Query-based compilers—systems that try to re-do only the parts of a build that changed—just got roasted. The article warns the “silver bullet” pitch is hype: if a tiny change blows up half the result (think encryption’s avalanche effect), you can’t cheat the work. Cue the comments setting the stage for a Zig vs Rust steel-cage match. One camp cheers Zig’s “parse each file alone” simplicity, while the Rust crowd counters with “macros are life,” arguing Rust’s powerful code-generation needs crate-wide (project-wide) smarts. The thread went full popcorn when a critic called the encryption example “bogus,” dropping a Merkle tree mic to say partial updates are possible. Others clapped back: great for hashing files, not magic for complex language rules. Meanwhile, a grumpy chorus dunked on “mass unqualified imports” (aka “bring everything, who cares?”) as a productivity trap, begging devs to use short aliases instead. Another voice pitched a truce: mix queries with a diff/patch style and treat “previous state” as input—like spreadsheets and UI frameworks that auto-update cells. The vibe? Half pragmatism, half fandom, with memes about “inner Grug” yelling “keep it simple” and jokes that compilers are turning into Excel. Hot, spicy, and extremely online.
Key Points
- •Query-based compilers model compilation as function-call graphs, enabling recomputation only along paths affected by changes.
- •Early cutoff optimization stops propagation when input changes do not alter a function’s output.
- •Incremental compilation aims for update time proportional to change size, crucial for IDE responsiveness (~100 ms budgets).
- •Fundamental limit: updates cannot be faster than the change in the result; avalanche effects (e.g., encryption) force O(N) work.
- •Language dependency structure determines effectiveness; the author recommends using query-based compilation as a fallback and designing for simpler, more direct pipelines (e.g., Zig’s per-file isolation).