Lurker News
Back to discussion

Comment by andsoitis

apignotti#
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.

pygy_3 replies#
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.

silon421 reply#
If I understand what cross-realm means (code security), then I'm not sure that can be done at all.
pygy_1 reply#
Firefox can’t eliminate tail call across realms. The spec could make an exception for that scenario

Continue this thread — 1 reply

leoc1 reply#
These absolute bozos. A Web Assembler that can't do jumps. What a show.
pygy_8 replies#
My comment is about ES6 proper tail calls. WASM is another story

Continue this thread — 8 replies

miclill1 reply#
Thanks for clarifying. What is this PTC you mention?
pygy_#
“Proper tail calls”, i.e. tail calls as specified for ES6
brrrrrm1 reply#
How is ECMAScript 6 (high level language) related to WebAssembly (low level target)?
afiori#
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)