Re:Functional Programmers need to take a look at Zig
by resonancel on Thursday April 30, 2026 @06:11AM
(#47960374)
You can think of comptime (as of zig 0.16) as an interpreter that evaluates code with very limited optimization. So yes, naive use of comptime can definitely grind compilation to a halt.
Zig tackles the halting problem a bit differently by putting the evaluation cutoff in userspace through the compiler builtin function `@setEvalBranchQuota`. You bump up the quota as you see fit.
Can comptime blow up compile times? Does it have arbitrary cutoffs like C++ template depth?