I use this page to collect my thoughts on Zig comptime, from conditional code and tagged-union subsets to why comptime matters in Ghostty. These ideas connect to my broader work with zig systems applications and my interest in zig compiler progress.
I described a Zig-related post as “4 billion if statements” in the “Zig edition.”
I said comptime is one of my favorite Zig features, and that conditionally disabling code is one of its many use cases.
After getting great feedback on my previous comptime post, I've decided to make this a series highlighting Zig comptime use cases.
In this post, I illustrate a much more complex example with tagged union subsets.
I think other languages should seriously consider comptime because its utility is so broad.
I said Ghostty would be significantly worse or messier without comptime.
Related: zig compiler progress, funding zig development, system design and performance