News for hackers. Stuff that matters.
Re:Tell HN: We are trying to get tail calls into the WebAsse... by randomswede on Wednesday July 13, 2022 @04:59AM (#32080368)
There are probably WebAssembly-specific things I am unaware of. So, the following is a general "TCO" discussion.

I normally consider TCO something that is a compiler feature. Replace a call to the head of yourself, with a jump (possibly to just after the "pull the arguments from the call stack to where the code wants it" prologue), making sure that the correct locals are present where they need to be.

Well, that's for self-TCO. General TCO is definitely trickier (probably requires juggling stack allocations so as to ensure that the tail-called function has enough space for all that it needs).

There are no comments on this comment yet.