Re:Tell HN: We are trying to get tail calls into the WebAsse...
by leoc on Tuesday July 12, 2022 @02:29PM
(#32073918)
These absolute bozos. A Web Assembler that can't do jumps. What a show.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by pygy_ on Tuesday July 12, 2022 @05:06PM
(#32075694)
My comment is about ES6 proper tail calls. WASM is another story
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by leoc on Tuesday July 12, 2022 @05:47PM
(#32076104)
Graaagh, sorry.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by int_19h on Tuesday July 12, 2022 @09:33PM
(#32077995)
It's not that much better. Apparently at least some of the idiosyncracies in the design of wasm, such as the lack of regular unstructured branches, is due to the internal implementation details of V8.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by titzer on Tuesday July 12, 2022 @11:08PM
(#32078616)
Every optimizing JIT for JavaScript has the same limitations.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by int_19h on Tuesday July 12, 2022 @11:46PM
(#32078829)
Then maybe we shouldn't be repurposing VMs written for JavaScript for that brand new thing? Ditch the baggage and do it right. Especially given that, if successful, wasm is basically the next JS, and will be around for decades.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by titzer on Wednesday July 13, 2022 @12:02AM
(#32078920)
I'm all for rewriting things from scratch. That's why I'm doing a new Wasm engine from scratch. But reusing TurboFan is how we took Wasm from concept to near-native performance, shipped in Chrome, in 2.5 years.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by int_19h on Wednesday July 13, 2022 @12:17AM
(#32078999)
That's all well and good - but, again, the spec will be around for decades. Compromises made today to ship things faster means a lot of pain in those years ahead. I pity all the compiler writers who will have to implement relooper again and again.
But instead we'll probably do things like asm.js - that is, bless certain wasm patterns such that advanced VMs would be guaranteed to optimize them. And so everything will be way more complicated than it needs to be. Just like the JS stack today.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by titzer on Wednesday July 13, 2022 @07:08AM
(#32081089)
That's why multiloop is coming.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by int_19h on Wednesday July 13, 2022 @09:53PM
(#32091067)
Has there been any movement on that (or funclets) recently? All the repos I can find haven't been updated in a while.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by silon42 on Tuesday July 12, 2022 @11:45AM
(#32071614)
If I understand what cross-realm means (code security), then I'm not sure that can be done at all.
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by pygy_ on Tuesday July 12, 2022 @11:53AM
(#32071734)
Firefox can’t eliminate tail call across realms. The spec could make an exception for that scenario
Re:Tell HN: We are trying to get tail calls into the WebAsse...
by dwheeler on Tuesday July 12, 2022 @04:16PM
(#32075068)
That seems reasonable. Tail call elimination, limited to within a realm, still seems pretty useful.
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.