⭐⭐⭐⭐⭐
Against Query Based Compilers
Compilers Build Systems Software Engineering
Summary
A critical analysis of query-based compilers, exploring the treacherous shoals and limitations of applying incremental computation concepts to compilers.
Key Insights
- What are Query-Based Compilers?: Application of incremental computation to compilers - treating compilation as a graph of function calls
- The Basic Idea: Visualize compiler run as a function call graph - if input changes, only recompute results on the path from changed input to root query
- Early Cutoff Optimization: If an input changes but result doesn't (e.g., whitespace change doesn't affect function type), stop change propagation early
- The Trap: The beauty of the scheme is its "silvery-bullety hue" - it can be applied without thinking, but that doesn't make it right
Core Insight: "Query based compilers are all the rage these days, so it feels only appropriate to chart some treacherous shoals in those waters."
Reference
Links to the canonical paper Build Systems à la Carte by Simon Peyton Jones and others.
Why This Matters
As incremental compilers and build systems become more popular, understanding their limitations helps avoid architectural mistakes. The author provides a nuanced, critical perspective that complements the hype.