I am unsure, but I can make a guess. The first release of Wasm has been always considered a Minimum Viable Product, which a strong emphasis on Minimum. Pretty much only features already part of the legacy asm.js "standard" made the cut.
The fact that WebKit had some level of support for tail calls on the JS side is exactly the reason we choose it as the right platform to invest in.
The standard mandates it, and the V8 team implemented it, shipped it behind a flag, then unshipped based on reasons that initially seemed and ultimately were proven fuddy, when WebKit shipped PTC, and the world didn’t fall down.
The reason actual why it was withdrawn is that it would have required expensive changes to Microsoft’s Chakra (the calling conventions were incompatible). Then Edge died... and Google didn’t add it back. Go figure. Firefox also has problems implementing cross-realm tail calls. That could be spec’ed around, but there’s no will to do so.
Wasm is meant to run efficiently on the same VM as JavaScript (an ECMAScript implemention), so Wasm features are restricted by browser VM current architectures.
(It is probably the main reason why Wasm only has structured control flow)
Do you know why it wasn't in the standard to begin with?
Even ECMAScript 6 mandates PTC (proper tail call) - article from 2016 on Webkit.org no less - https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-...
The fact that WebKit had some level of support for tail calls on the JS side is exactly the reason we choose it as the right platform to invest in.
The reason actual why it was withdrawn is that it would have required expensive changes to Microsoft’s Chakra (the calling conventions were incompatible).
Then Edge died... and Google didn’t add it back. Go figure.
Firefox also has problems implementing cross-realm tail calls. That could be spec’ed around, but there’s no will to do so.
Continue this thread — 1 reply
Continue this thread — 8 replies
(It is probably the main reason why Wasm only has structured control flow)