Re:Maintain It with Zig
by dnautics on Wednesday September 08, 2021 @06:46PM
(#28464002)
It's duck typed but let's say your "template" takes an integer and divides by two depending on some boolean (perhaps you need to return a lookup table of sometimes half the bitwidth of an integer type). That function called by your template at compile time to maybe-divide-by-two is in the same language as runtime zig, and you could even conceivably call that very same function as a compiled entity in the runtime context.
[ Parent
| on HN ]
There are no comments on this comment yet.