Earlier quoted context omitted.
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.
Build Your Own WebAssembly Compiler
11–20 of 20 posts
Re: Build Your Own WebAssembly Compiler
#12Are there any fast ways to run wasm on systems that forbid creating new executable pages? A high performance interpreter?
What system do you mean? iOS supports wasm AFAIK.
Re: Build Your Own WebAssembly Compiler
#13Are there any fast ways to run wasm on systems that forbid creating new executable pages? A high performance interpreter?
check this one: https://github.com/wasm3/wasm3
Re: Build Your Own WebAssembly Compiler
#14Re: Build Your Own WebAssembly Compiler
#15Earlier quoted context omitted.
What system do you mean? iOS supports wasm AFAIK.
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?
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
#16Re: Build Your Own WebAssembly Compiler
#17Earlier quoted context omitted.
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.
WKWebView does as well because it too runs out-of-process. You can load WebAssembly into it.
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
Re: Build Your Own WebAssembly Compiler
#18Re: Build Your Own WebAssembly Compiler
#19Documentation on how Lobster's Wasm-backend works, which contains plenty of useful info for anyone making their own backend: http://aardappel.github.io/lobster/implementation_wasm.html
Re: Build Your Own WebAssembly Compiler
#20Earlier quoted context omitted.
check this one: https://github.com/wasm3/wasm3
Nice find, only 4.5x slower is nothing to sneeze at. I doubt that WASM is optimal for interpretation and you could probably gain another 2x through a bytecode compilation target optimized for interpreting.