11 ms·
> "I'd love to hear about some actual use case for this" I use WebAssembly for non security critical but fun in browser Augmented Reality experiences. We have
by mbzi 7y ago
> "I'd love to hear about some actual use case for this"
I use WebAssembly for non security critical but fun in browser Augmented Reality experiences. We have an ever improving 10 year old fully tested C++ SDK which has bindings to iOS, Android, Windows (DLL, Electron forms), and macOS. We use Emscripten to transpile our code to ASM.JS and WebAssembly for the JavaScript in browser version.
From a company perspective it is great to reuse well tested code on another platform without investing time rewriting it.
From a developer perspective it allows my R&D engineers to write what they love in the language of their choice. Not fighting a new language each time.
From a user perspective the speed of WASM is significantly faster than pure JS and even ASM.js. This increases the experience frame rate from ~30 to 60+.
So all in all I am a huge fan of WebAssembly experiences. The only major problem encountered was when Spectre / Meltdown appeared we had issues around SharedArrayBuffer which resulted in temporarily moving clients from WASM to ASM.JS, but we have found solutions for this since.
- jedisct1 7y agoSure, but this is off-topic. My question was about why one would want to call WebAssembly functions from Go or PHP.
- 8lall0 7y agoYou can use wasm as a lingua franca between languages if you have some good libraries or programs that you want to share.
- jedisct1 7y agoLike... a shared library? I have a single libmysql.so file installed on my system, and it's used by Python, Ruby, C and PHP. Why should I replace libmysql.so with libmysql.wasm?
- chownie 7y agoBecause libmysql.wasm runs on any platform whereas libmysql.so has to be replaced with libmysql.dll on windows.
- pjmlp 7y agoJust like libmysql.dll, that libmysql.wasm will only run on Windows, if there is a Windows application that knows what to do with it.
- asdkhadsj 7y agoYea, that's generally how code works - no? This is simply an abstraction "everyone" has agreed on. Conceptually no different than if everyone had agreed on Java, or Python, or Brainfuck.
- pjmlp 7y agoExactly, and neither the first not the last at it.
- asdkhadsj 7y agoBut that's not a bad thing. To me it appears better than previous attempts, I heavily look forward to it. The HN drama around WASM and cries of the days of Java always leave me perplexed. Makes me wish Java didn't suck so bad so these convos could end haha.
- solidsnack9000 7y agoA shared library isn’t really shareable across OSes or platforms. The neat thing about a WASM library is you can load it in your browser, in your native app or in your Python script.
- pjmlp 7y agoJust like we used to do with Pascal P-Code interpreters back in the day.