4 ms·
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...
by simias 9y ago
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...
- panic 9y agoMost assembly languages have a "jump" instruction, though -- wasm supports only structured control flow.
- pjmlp 9y agoIt has br and loop, good enough.
- int_19h 9y agoI 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).
- Nullabillity 9y agoJMP is the original TCO.