Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Does 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


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: