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

Couldn't the compiler take care of optimizing those when necessary? After all I don't know of any "real" assembly with tail call support...


Most assembly languages have a "jump" instruction, though -- wasm supports only structured control flow.


It has br and loop, good enough.


I don't think it's sufficient for full-fledged generalized tail call elimination. You can certainly optimize a self-recursive call down to a loop, but consider a case where a function accepts another function as a pointer, and invokes that pointer in a tail call position, for example (i.e. anything written in continuation-passing style).


JMP is the original TCO.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: