3 ms·
"There is one thing that may have been a major factor to the decision not to adopt arbitrary CFGs for WebAssembly control flow. I believe that V8 is an exceptio
by int_19h 7y ago
"There is one thing that may have been a major factor to the decision not to adopt arbitrary CFGs for WebAssembly control flow. I believe that V8 is an exception to most compilers in that it doesn’t represent code as a CFG at all - it maintains roughly JS-compatible control flow all the way from front-end to codegen. In order to support this V8 would have to be converted to use CFGs, they’d have to implement something like Relooper internally, or they’d have to write a new WebAssembly runtime from scratch. Google was and is a major roadblock to getting this implemented as they have multiple people on the committee in charge of WebAssembly who have veto power."
- sieabahlpark 7y agoGood ol Google being the opposite of what got them where they are currently.
- est31 7y ago> they have multiple people on the committee in charge of WebAssembly who have veto power Note that even if Google did not have people on that committee, they'd just not implement the feature in their browser, and the feature would be dead in the water. Outside of niche cases where browser choice is controlled, no web dev would adopt features that > 70% of users can't use. So the committee only reflects power dynamics that exist in the greater browser sphere. In fact, non-Google browsers probably have more seats than they have influence by raw market share.
- leoc 7y ago> So the committee only reflects power dynamics that exist in the greater browser sphere. It doesn't only reflect them, but also amplifies them. Quietly nobbling things in committee is surely a lot easier than having to field questions about why you aren't implementing Web standards (insert quotation marks as desired). There's also the danger of being embarrassed when someone writes a library which runs slowly on your browser and fast on others.
- pjmlp 7y agoAnd they already had PNaCL, which was literally vetoed by the other browser vendors, politics.
- klodolph 7y agoCalling it “politics” is a disservice. PNaCL was closely tied to Chrome (+ PPAPI), but it paved the way for WASM. Mozilla’s asm.js was a different step leading in the same direction.
- pjmlp 7y agoYes it was politics, it was open source and others were invited to contribute, instead Mozilla came up with convoluted asm.js as alternative. And it remains to be seen when WASM will reach parity with PNaCL features, most likely 5 more years or so. It is incredible how politics slow down innovation.
- flohofwoe 7y agoEh, PNaCl had its own share of problems (the only feature it had even over asm.js was pthread-style threading, but performance was about even and first time upstart speed for a new code blob was a lot slower both than asm.js and Wasm). But as the "whole developer package", PNaCl quickly fell behind emscripten: The whole feature area of interacting with the Javascript and web-API side was basically non-existant, or at best difficult (it felt more like JNI in the Android SDK/NDK), while emscripten treated this as important feature to get right from the start. Emscripten realized early how important it is to support porting existing code bases and added shims for quite a few popular cross-platform APIs. Working with the PNaCl SDK was just barely better than the Android NDK (which is pretty much the yardstick for the worst developer experience possible), and development just wasn't as fast and "pragmatic" than emscripten and asm.js (despite emscripten basically being a "one man show" for a long time). TL;DR: PNaCl nostalgia considered harmful ;)
- pjmlp 7y agoWebAssembly hype is also considered harmful. "Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code" https://www.usenix.org/system/files/atc19-jangda.pdf https://www.usenix.org/system/files/atc19-jangda.pdf SIMD in PNaCL https://developer.chrome.com/native-client/reference/pnacl-c-cpp-language-support#portable-simd-vectors https://developer.chrome.com/native-client/reference/pnacl-c... Currently at phase 3 on WebAssembly GC in PNaCL, https://chromium.googlesource.com/native_client/pnacl-llvm/+/upstream/master/docs/GarbageCollection.rst https://chromium.googlesource.com/native_client/pnacl-llvm/+... Currently at phase 1, on hold due to reference types, and still remains to be seen how to proceed. Tail Calls in PNaCL https://developer.chrome.com/native-client/reference/pnacl-bitcode-manual#direct-procedure-call https://developer.chrome.com/native-client/reference/pnacl-b... Currently at phase 3. WebAssembly is so much better than the migration documentation from PNaCL into WebAssembly is full of "Not Implemented", "In future HTML 5 API", "Being worked on", .... https://developer.chrome.com/native-client/migration https://developer.chrome.com/native-client/migration The irony of all of this, it that Chrome and Safari (mostly due to iOS) are what most developers nowadays care about, so we might end up with WebAssembly that works best on Chrome, coming full circle. And the current WebAssembly development experience is also not something to be proud of, see Ashley Williams talk at WebAssembly Summit. I do agree about the sore state of Android NDK, despite many improvements in the last 10 years, to the point that I think by making it such an unbearable experience to use C and C++, it is one of the mechanisms Google uses to improve Android's security.