I guess I have a misunderstanding of zig as being “eagerly comptime” because there are builtins which are automatically comptime (@TypeOf, @typeInfo), but I won’t get the same automatically comptime-ness with my own functions.
I wonder if it would be nice to be able to mark my function as comptime-only…
the compiler will not evaluate function calls at comptime, even if all the parameters are known at comptime, unless you tell it to.
i dont see comptime fn being a thing as then at the call sight you dont know if its called at comptime without checking the fn definition. the function could also be rather expensive to call which would be bad to run at compile time unless it was explicitly asked for.
By making the function inline you can essentially get the result you want. This is because inline in Zig means that the function body is semantically inlined at the call site.