Comment on Resizable structs in ZigparentComments−eru1yDoes Zig offer (guaranteed) tail call optimisation?Where recursion is useful, [...]Recursion is so useful, most imperative languages even have special syntax constructs very specific special cases of recursion they call 'loops'.−messe1yDoes Zig offer (guaranteed) tail call optimisation?Yes[1]. You can use the @call builtin with the .always_tail modifier. @call(.always_tail, foo, { arg1, arg2, ... }); [1]: https://ziglang.org/documentation/master/#call
Comments
Does Zig offer (guaranteed) tail call optimisation?
Recursion is so useful, most imperative languages even have special syntax constructs very specific special cases of recursion they call 'loops'.
Yes[1]. You can use the @call builtin with the .always_tail modifier.
[1]: https://ziglang.org/documentation/master/#call