The new multi-pass type resolver feels like Zig is edging toward a proper HIR/typed-HIR split a la Rust, except with comptime evaluable in the same pass so you do not need a separate const-fold stage. I am keen to see how this influences the generic recursion checker now that value-dependent types are first-class.
Comptime-in-pass is slick but I worry about the hit on incremental builds; any word on caching comptime evaluations so the new recursion checker does not re-run the whole world?
Zig already fingerprints each comptime fn and its input values (stage2 docs mention a content-addressed cache), so only nodes whose hash changes get re-evaluated during an incremental build. If the recursion checker keys off the same hash, you are looking at O(changed_nodes) work, which is about the best consistency you can squeeze out here without violating the CAP tradeoffs.
The new multi-pass type resolver feels like Zig is edging toward a proper HIR/typed-HIR split a la Rust, except with comptime evaluable in the same pass so you do not need a separate const-fold stage. I am keen to see how this influences the generic recursion checker now that value-dependent types are first-class.
Comptime-in-pass is slick but I worry about the hit on incremental builds; any word on caching comptime evaluations so the new recursion checker does not re-run the whole world?
Zig already fingerprints each comptime fn and its input values (stage2 docs mention a content-addressed cache), so only nodes whose hash changes get re-evaluated during an incremental build. If the recursion checker keys off the same hash, you are looking at O(changed_nodes) work, which is about the best consistency you can squeeze out here without violating the CAP tradeoffs.