Hacker News new | ask | show | jobs
by yuri91 1433 days ago
Actually even C++ can benefit from this.

In LLVM C++ coroutines compile down to functions with the "musttail" attribute, that right now is not possible to express in Wasm [1].

It is also useful to efficiently implement stuff like interpreters, where you use it as a way to jump to the code of the next instruction directly (Wasm has only structured control flow, but you can see a tail call as a sort of jump/goto instruction)

[1]: https://discourse.llvm.org/t/supporting-coroutines-without-t...