r/Compilers • u/matthieum • Jul 28 '26
Inside Zig's Incremental Compilation | mlugg
https://mlugg.co.uk/posts/incremental-compilation-internals/
47
Upvotes
r/Compilers • u/matthieum • Jul 28 '26
View all comments
6
u/matthieum Jul 28 '26
Of particular interest to me, here, is the ZIR.
After parsing, the Zig compiler converts to the AST to a ZIR:
Due to being untyped -- and the symbols being unresolved -- the conversion is entirely self-contained.
I must admit I do wonder as to why the AST is converted to ZIR, and the blog post unfortunately doesn't address it. Introducing an intermediate model has a cost, so there must be some benefit to it... Perhaps its flatter nature (compared to the AST)?