News for hackers. Stuff that matters.
Re:Bringing the web up to speed with WebAssembly by weinzierl on Friday September 22, 2017 @02:59PM (#15314801)
I'm quite excited about WASM (as I was, admittedly, about Java Applets in the 90s), but this is a question that haunts me. I wish someone with better understanding of WASM and Java than me could write up why byte code delivery to a sandboxed VM in the browser failed in the 90s and why we should believe it will succeed now, or what exactly WASM brings to the table that Java didn't.
Re:Bringing the web up to speed with WebAssembly by catdog on Friday September 22, 2017 @04:54PM (#15315705)
I think it mainly failed because Sun basically abandoned it. Security was not the issue I think (Flash was the same, maybe worse, still widely used) but the UX was quite terrible and never really improved: You had the jvm with its long startup times which was more than noticeable in the 90s and early 2000s. Applets always felt very alien inside a Website and using the applet simply to call into optimized code from JS was, while possible not really what it was used for.

Security maybe more of an issue today but WASM probably is not worse than JS in that regard (basically it's just another turing complete language). As others have said APIs are more problematic, which I suspect will ever get worse while browsers further and further try to transform from document viewers to application runtimes (think of such "brilliant" ideas like WebUSB). WASM is not the key issue here, it's running untrusted code on the client which, even if it's sometimes not outright harmful takes control away from the user in one way or antother. In the end the main difference is that it's now a feature of the Browser rather than a plugin which has a hard time to fit in nicely.

Re:Bringing the web up to speed with WebAssembly by ryacko on Friday September 22, 2017 @05:57PM (#15316222)
Virtual machines tend to take a while to initialize, for Java in part to verify the code.
Re:Bringing the web up to speed with WebAssembly by kodablah on Friday September 22, 2017 @03:10PM (#15314895)
If it were just the bytecode then it would not have failed. JVM bytecode and WASM have plenty of similarities. What cost Java is the stdlib surface area and security model. Also that it is a separate runtime was annoying, like Adobe with Flash, there was one primary vendor.

So many JVM bugs and a huge stdlib. WASM has no real lib, and when it does, it's security model is already restrictive... there's no disk, network, threads (yet), etc.

Re:Bringing the web up to speed with WebAssembly by Rusky on Friday September 22, 2017 @05:35PM (#15316052)
Along with the other responses, the JVM imposes its own object model on any language implemented on top of it. WebAssembly does not, so it is vastly simpler and more flexible.

For example, you had to rewrite your apps to run as Java applets. You do not have to rewrite things to run on WebAssembly- all the existing C, C++, etc. code is compatible, up to the platform API.

Re:Bringing the web up to speed with WebAssembly by dikaiosune on Friday September 22, 2017 @07:15PM (#15316794)
This is of course assuming that the WASM GC proposal doesn't require a specific object model to get host GC interop.
Re:Bringing the web up to speed with WebAssembly by Rusky on Saturday September 23, 2017 @01:28AM (#15318308)
So far it doesn't look like it will: https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...

But either way, I'd still take "use this object model for host GC interop" over "use this object model or leave the platform."

Re:Bringing the web up to speed with WebAssembly by jandrese on Friday September 22, 2017 @04:17PM (#15315417)
A big reason Java failed was that it was painfully slow. Starting the VM and importing everything took tens of seconds on old machines, and still takes a couple of seconds on new ones.

Then people started worrying about security and all of the Java applets broke because nobody wants to go through that code signing process.

I have to admit I don't know much about the security model of WebAssembly, but I wonder if it will become as annoying as Java in the future.

Re:Bringing the web up to speed with WebAssembly by AgentME on Friday September 22, 2017 @04:49PM (#15315668)
>I have to admit I don't know much about the security model of WebAssembly, but I wonder if it will become as annoying as Java in the future.

WebAssembly in browsers executes similarly to javascript in the same sandbox with the same platform APIs with the same kind of delivery methods, so I don't think we have that to worry about.

Re:Bringing the web up to speed with WebAssembly by tannhaeuser on Friday September 22, 2017 @03:14PM (#15314918)
That's very much the question indeed. All that's really needed for a native experience on both Android and iOS is a native ARM binary, optionally bundled with webkit, but then that's what native runtime environments for Android and iOS have already built-in.