Re:Build Your Own WebAssembly Compiler
by vbezhenar on Friday December 27, 2019 @05:23PM
(#21895265)
What system do you mean? iOS supports wasm AFAIK.
[ Parent
| on HN ]
Re:Build Your Own WebAssembly Compiler
by ridiculous_fish on Friday December 27, 2019 @10:22PM
(#21896840)
Not iOS but it's an interesting thought experiment: if you wanted to build a fast WASM implementation for iOS, how would yo do it?
If your WASM code doesn't change (isn't being downloaded at runtime from the Internet), then you could ahead-of-time compile it to native machine code (ARM/ARM64) and link it into your app.
It doesn't look like anyone's tried to do it for iOS but InNative has a compiler for Windows/Linux.
Re:Build Your Own WebAssembly Compiler
by jimmcslim on Friday December 27, 2019 @05:28PM
(#21895311)
Mobile Safari may support WASM, but I think the GP is suggesting that a native iOS app would not be permitted to load, compile, and execute a WebAssembly module.
Re:Build Your Own WebAssembly Compiler
by vbezhenar on Friday December 27, 2019 @05:42PM
(#21895420)
I might be wrong, but I think that one should be able to utilize JavaScript engine within native iOS app which will use fast implementation.
JavaScriptCore and JS running in a web page using WKWebView are both running in the same app process and do not support WASM since they cannot generate code (cannot write to executable memory pages).
SFSafariViewController does support WASM by executing in a separate more privileged process but interaction with the app is very limited.
Re:Build Your Own WebAssembly Compiler
by saagarjha on Friday December 27, 2019 @10:01PM
(#21896752)
WKWebView does as well because it too runs out-of-process. You can load WebAssembly into it.
Re:Build Your Own WebAssembly Compiler
by throwGuardian on Saturday December 28, 2019 @05:50AM
(#21898278)
But WKWebView is equivalent to running inside a browser, with no system access.
If JSCore allowed WASM JIT-ing, one could easily port WASI to iOS for full system access, and update iOS apps by downloading new wasm versions. Of course Apple won't do that citing __Insert__App__Store__excuse__here, but everyone knows it's because they want that sweet 30% cut, and that can only be effectively enforced with a tight chokehold on updates