News for hackers. Stuff that matters.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by jedisct1 on Thursday May 30, 2019 @04:48AM (#20049448)
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?

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by mbzi on Thursday May 30, 2019 @05:45AM (#20049674)
> "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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by jedisct1 on Thursday May 30, 2019 @08:08AM (#20050330)
Sure, but this is off-topic.

My question was about why one would want to call WebAssembly functions from Go or PHP.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by 8lall0 on Thursday May 30, 2019 @08:21AM (#20050407)
You can use wasm as a lingua franca between languages if you have some good libraries or programs that you want to share.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by jedisct1 on Thursday May 30, 2019 @12:00PM (#20052509)
Like... 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?

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by chownie on Thursday May 30, 2019 @01:57PM (#20054090)
Because libmysql.wasm runs on any platform whereas libmysql.so has to be replaced with libmysql.dll on windows.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by pjmlp on Friday May 31, 2019 @02:50AM (#20058737)
Just like libmysql.dll, that libmysql.wasm will only run on Windows, if there is a Windows application that knows what to do with it.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by asdkhadsj on Friday May 31, 2019 @12:55PM (#20062671)
Yea, 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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by pjmlp on Friday May 31, 2019 @04:15PM (#20064539)
Exactly, and neither the first not the last at it.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by asdkhadsj on Saturday June 01, 2019 @11:28AM (#20069642)
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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by pjmlp on Saturday June 01, 2019 @12:03PM (#20069818)
All previous attempts, starting all way the back to UNCOL in 1958?

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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by asdkhadsj on Sunday June 02, 2019 @09:47AM (#20075408)
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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by pjmlp on Monday June 03, 2019 @03:01AM (#20081013)
I complain about the adoration, like WASM was some kind of gift from God and everyone else that came before never existed.

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.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by asdkhadsj on Wednesday June 05, 2019 @05:21PM (#20109293)
> 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?

Sigh.

Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by solidsnack9000 on Thursday May 30, 2019 @06:21PM (#20056528)
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.
Re:Show HN: Wasmer – A Go library for executing WebAssembly ... by pjmlp on Friday May 31, 2019 @02:50AM (#20058741)
Just like we used to do with Pascal P-Code interpreters back in the day.