METABYTE
Back to articles

Against Query Based Compilers: A Developer's Manifesto for Simplicity

Rust developer Alex Kladov argues against query-based compilers, advocating for simpler, more explicit architectures.

9 mai 20262 min read
Against Query Based Compilers: A Developer's Manifesto for Simplicity

Remember when your teacher said, "Don't write a conditional if you can avoid it"? Alex Kladov, known for his work on the Rust compiler, is here to remind us that query-based compilers are no silver bullet—they're more like a Swiss Army knife with too many blades you'll never use.

In his post "Against Query Based Compilers," he dissects the trendy architecture where every piece of info is a cached query that recomputes only when dependencies change (think rust-analyzer or Salsa). Sounds neat, right? But in practice, Kladov argues, it turns into a state machine nightmare where debugging feels like untangling a ball of yarn that a cat played with.

He claims query-based approaches add accidental complexity. Comparing it to using an ORM for a two-table join—convenient until the database grows and you curse the day you started. Instead, he advocates for more straightforward methods: explicit AST traversals, manual incrementalism, and less magic.

Naturally, this will spark debate. Many tooling developers have invested heavily in query-based designs. But as they say, if you can't explain your compiler to your grandma, maybe it's too complex. And if your grandma is a Haskell programmer, even more so.

METABYTE studio comment: We love architectural experiments, but when a project starts resembling an IKEA assembly without instructions, it's time to remember KISS. Need a compiler or tooling that doesn't melt your brain? We know how to keep it simple and effective.

NEXT STEP

Liked the approach?

We apply the same principles to client projects: AI, automation, products that don't die after launch.