# Container-level comptime vars

**URL:** <https://ziggit.dev/t/container-level-comptime-vars/3678>\
**Category:** Help\
**Tags:** language\
**Created:** [March 24, 2024, 12:37pm UTC](https://ziggit.dev/t/container-level-comptime-vars/3678 "2024-03-24T12:37:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mlugg](https://ziggit.dev/user_avatar/ziggit.dev/mlugg/32/437_2.png) [@mlugg](https://ziggit.dev/u/mlugg)\
**Post date:** [March 24, 2024, 4:49pm UTC](https://ziggit.dev/t/container-level-comptime-vars/3678/5 "2024-03-24T16:49:57Z")

</div>

This code will be broken by my [recent PR](https://github.com/ziglang/zig/pull/19414). 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 var`s will also be disallowed from becoming runtime-known to avoid issues related to mutating `comptime var`s 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.

---

_[View the full topic](https://ziggit.dev/t/container-level-comptime-vars/3678)._
