Thanks for the ping! We decided to use the same name (Wasmer) for the language embeddings as for the standalone runtime as we thought it could be easier for people to find related resources for the runtime. Hopefully is not too confusing! :)
WebAssembly is still being designed as we speak, but I love how Wasmer has been the "less talk more action" actor since the beginning.
That being said, and while it's cool to be able to run WebAssembly code from PHP, Ruby, Python or Go, I'd love to hear about some actual use case for this.
Being able to reuse code across multiple languages is nice, but that's already doable, and usually easier and faster, by building a shared library and using a FFI interface.
Is it only about the debatable security of WebAssembly's linear memory model?
> "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.
But 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.
And if Java managed to get a hold we'd be asking why this is better than Java (which doesn't exist with these features in this manner).
That's the point. It's seemingly good, and available. Why the pushback? I don't get your (or anyones) objections.
> If Chrome already had the current market share back then, we wouldn't be seeing such adoration, as if no one ever done it before.
I think you misunderstand the adoration. It's not as if this has never been done before. It's that this isn't done now. What else can I use? Nothing. I remember 10 years ago dying for a way to run Python in the browser and having no reasonable options for general web.
Even now, what other option do I have? ASM.js is the only thing that comes to mind, which has significant downsides.
It feels like the dislike/complaints are pointed in the wrong direction. If you're upset that this isn't Java (not that you are), complain about why Java can't be used right now like WASM can. Complain that Java didn't manage to hold favor 10 years ago.
> 10 years ago there were ways run Python in the browser. ActiveState used to have such plugin for example.
I didn't say it was impossible, but it's a massive stretch to compare WASM now and some hack that worked if you had the right plugins installed. Common dude, that's just disingenuous.
edit: To think of it differently, I'm able to compile any language to run on any modern browser (which is most these days). I can even do it at my work, since we support Chrome. This was never possible before. I waited for years to run Python in browser without hacks or trickery. You're thinking I just oopses, missed that this was all possible before?
A 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.
20 comments
[ 3.1 ms ] story [ 41.7 ms ] threadThat being said, and while it's cool to be able to run WebAssembly code from PHP, Ruby, Python or Go, I'd love to hear about some actual use case for this.
Being able to reuse code across multiple languages is nice, but that's already doable, and usually easier and faster, by building a shared library and using a FFI interface.
Is it only about the debatable security of WebAssembly's linear memory model?
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.
My question was about why one would want to call WebAssembly functions from Go or PHP.
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?
This is simply an abstraction "everyone" has agreed on. Conceptually no different than if everyone had agreed on Java, or Python, or Brainfuck.
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.
WASM only exists due to political reasons of Mozilla not embracing PNaCL.
If Chrome already had the current market share back then, we wouldn't be seeing such adoration, as if no one ever done it before.
That's the point. It's seemingly good, and available. Why the pushback? I don't get your (or anyones) objections.
> If Chrome already had the current market share back then, we wouldn't be seeing such adoration, as if no one ever done it before.
I think you misunderstand the adoration. It's not as if this has never been done before. It's that this isn't done now. What else can I use? Nothing. I remember 10 years ago dying for a way to run Python in the browser and having no reasonable options for general web.
Even now, what other option do I have? ASM.js is the only thing that comes to mind, which has significant downsides.
It feels like the dislike/complaints are pointed in the wrong direction. If you're upset that this isn't Java (not that you are), complain about why Java can't be used right now like WASM can. Complain that Java didn't manage to hold favor 10 years ago.
10 years ago there were ways run Python in the browser. ActiveState used to have such plugin for example.
Why do you think there is a language attribute on the <script> tag?
And for some strange reason, the same ones that adore WASM, seem to only be aware of Java as bytecode format and nothing else.
I didn't say it was impossible, but it's a massive stretch to compare WASM now and some hack that worked if you had the right plugins installed. Common dude, that's just disingenuous.
edit: To think of it differently, I'm able to compile any language to run on any modern browser (which is most these days). I can even do it at my work, since we support Chrome. This was never possible before. I waited for years to run Python in browser without hacks or trickery. You're thinking I just oopses, missed that this was all possible before?
Sigh.