News for hackers. Stuff that matters.
Re:WebAssembly Studio by dboreham on Thursday December 31, 2020 @11:53AM (#25594355)
I'm also intrigued by the possibilities of WebAssembly. However I also have a nagging feeling "didn't we already do this with Java, 20 years ago?". Wondering what's different this time, or is this just a MySpace vs Facebook second-times-the-charm thing.
Re:WebAssembly Studio by TheRealPomax on Thursday December 31, 2020 @12:06PM (#25594500)
For one, no one needs to install WASM, nor are they going to run into versioning issues because the OS has a hard dependency on it. Every single person with a computer, from a smart phone to render farm workstations, will have WASM support because those devices will have a browser. The only browser that doesn't support it is the legacy IE line of browsers, of which only 11 is still supported, and which only runs on systems that will happily run Edge, instead.

Devs can rely on the fact that users won't need to install a single thing, and users can rely on the fact that they're not going to have to go through the insanity that is "trying to install the right version of Boobletech(tm) Meep(r)" or, hell: "trying to get their OS to even acknowledge that the preinstalled version of java is over a decade old and it needs to stop using it instead of the new version you installed".

If your compiler can target WebAssembly, and your users are on computers with operating systems that are still supported, your WASM application will work for them, because everyone has a browser.

Re:WebAssembly Studio by worik on Thursday December 31, 2020 @04:50PM (#25597565)
Unless your user is using a iPhone.
Re:WebAssembly Studio by TheRealPomax on Thursday December 31, 2020 @11:44PM (#25600925)
Not unless your iphone is a hand-me-down from someone who themselves got it as a hand-me-down?

https://caniuse.com/?search=wasm

Re:WebAssembly Studio by austincummings on Thursday December 31, 2020 @05:02PM (#25597690)
Safari has support for WebAssembly.
Re:WebAssembly Studio by codeflo on Thursday December 31, 2020 @01:17PM (#25595332)
I’m not sure either. There are some technical differences. WASM is more low-level than JVM bytecode, which is important for some applications and makes it a more normal compiler target. It’s more integrated with the rest of the browser: it doesn’t come with its own rectangle like Flash and Java did, but instead manipulates the DOM just like (or at the moment, only through) JavaScript. And it’s a true open standard, not a corporate-controlled platform.

Do these differences really matter, or is it mostly just the timing?

Re:WebAssembly Studio by brabel on Thursday December 31, 2020 @02:00PM (#25595854)
WASM is definitely more low-level than JVM byte code right now... but I'm not sure it'll remain that way given the many proposals that are very likely to be implemented in the future (even though it's taking a long time for even simple ones, like multi-value returns, to get into the standard). For example, with WASI and GC, which will finally enable direct access to the DOM, how much lower-level will WASM be compared to JVM? Not much, I would say.

The big difference is that WASM, from the beginning, is supported by all the browsers natively (a consequence of it not being a proprietary technology, but an open standard), not as a plugin... If Java had started that way, the story would've turned out quite differently (but we know that at the time, the browser everyone was using was made by Microsoft, and Sun was a competitor so this would've never happened).

Re:WebAssembly Studio by novok on Thursday December 31, 2020 @01:26PM (#25595438)
It starts immediately, while any embedded java applet took forever and looked really ugly. We've also done this with flash apps
Re:WebAssembly Studio by tadfisher on Thursday December 31, 2020 @12:11PM (#25594556)
The difference is that wasm is designed to be sandboxed, instead of the JVM which was designed to normalize disparate computing environments. In practice, this entails a lot of work to create runtimes to do anything interesting in wasm, but the behavior is secure by default (ignoring side-channel attacks, of course). Java applets run in a sandbox by default, of course, but the JRE itself has unmitigated access to the host system, so the security boundary isn't as well defined. Users can also be tricked to trust malicious applets, which is a built-in mechanism to escape the sandbox; browsers hopefully will not provide this feature for their wasm runtimes.
Re:WebAssembly Studio by WalterGR on Thursday December 31, 2020 @12:14PM (#25594599)
> the JRE itself has unmitigated access to the host system

As does the browser in which WebAssembly executes.

> Users can also be tricked to trust malicious applets

But the ability of applets to be trusted could have been eliminated entirely. To rewrite OP's question, then:

"If we had entirely gotten rid of trusted applets, couldn't we already do this with Java, 20 years ago?"

Of course, we didn't get rid of them, but that's still a valid question vs. inventing another technology.

Re:WebAssembly Studio by codeflo on Thursday December 31, 2020 @01:26PM (#25595433)
Interesting thought experiment. However, you have to realize that Sun wasn’t a charity. At the time, platform vendors were were hoping to target intranet applications for the enterprise. Microsoft had a similar concept for trusted applications with IE’s “Active Scripting”, with very similar results in terms of (non)security.
Re:WebAssembly Studio by Closi on Thursday December 31, 2020 @01:21PM (#25595387)
Can't we just do this in sandboxed regular assembly running inside a virtual machine?!

/s

Re:WebAssembly Studio by asiachick on Thursday December 31, 2020 @09:35PM (#25600258)
which assembly?