1
Zig: Type Resolution Redesign and Language Updates (ziglang.org) programming zig
by raven 29 days ago | 3 comments
  1. ~

    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.

    1. ~

      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?

      1. ~

        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.