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
Show parent comment
4
u/mamcx Jul 28 '26
Older articles show why: https://mitchellh.com/zig/astgen
In general, you add another pass to make easier to do the next.
Intermediated representation are created for 2 main reasons:
The last is the important one. If you do
AST -> Assemblerand you read theAssembleryou have no way to know what kind of AST was actually use, that impact everything from debugging, error messages, caching, etc.Your intermediate is to know
a in AST is 0x.. there