by acqq · 6y ago · 0 comments
https://ziglang.org/documentation/master/#comptime
See an example calling firstNPrimes. "When we compile this program, Zig generates the constants with the answer pre-computed." "Note that we did not have to do anything special with the syntax of these functions. For example, we could call the sum function as is with a slice of numbers whose length and values were only known at run-time."
Then see "Case Study: printf in Zig"