Container-level comptime vars

This code will be broken by my recent PR. Zig will not support global comptime state for several reasons:

  • it makes incremental compilation virtually impossible
  • it makes analysis order – an implementation detail – observable

Pointers to comptime vars will also be disallowed from becoming runtime-known to avoid issues related to mutating comptime vars at runtime.

What you (OP) want here is an explicit non-goal I’m afraid, and this part of the language design is almost guaranteed to not change too significantly.

2 Likes