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

> What practical patterns are enabled by TCO in C?

It's important in interpreters. Here's an example: https://blog.reverberate.org/2021/04/21/musttail-efficient-i...



I get that, but a lot of C interpreters use switch, for example Lua:

https://www.lua.org/source/5.5/lvm.c.html#vmdispatch


Switch is fine if you don't care about performance. If you do care about performance then direct threading is faster. Direct threading uses tail calls.

More here: https://noelwelsh.com/posts/understanding-vm-dispatch/




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

Search: