The big win is the runtime doesn't need to check pointers for validity. However there are some downsides relative to native code:
1. Can't address more than 4GB of memory
2. Can't be efficiently implemented on 32 bit systems
3. Can't share memory between WASM modules
4. NULL dereferences don't trap (I think)
I would not be surprised if future CPUs had hardware support for this stuff, e.g. load/stores with a mask to confine the pointers.
https://www.youtube.com/watch?v=glL__xjviro
"The Security Risk of Lacking Compiler Protection in WebAssembly"
Currently WASM is both a client side and server side runtime. It's not clear where it will be in 5 or 10 years. I don't see a compelling server side story. Why WASM and not C#, Java, Node, Python, Rails (I intentionally don't write Ruby) or whatever any of us is using now with its standard runtime?
What makes you say Wasm is a server side runtime / imply that it's meant to be one?
There have been a few people who say if wasm (WASI on the server) existed already, Docker wouldn’t need to exist. Docker runs a whole OS just to run your binary - imagine the benefits of Docker but just running your binary.
It’s all early days so I am slightly waving my hands, but a lot of this works now. Check out _wasmtime_.
I think I've seen wasmtime before. If I needed to interface to any C/C++ things on the server I would probably just write in C/C++ (or Gx) yeah.
Say you are a C# developer and there is a C / C++ / Rust thing you want to use as a dependency.
Well, WASM is your interop layer. Same with Node.js, Deno, Go etc. You can start to share alot more code with a solid interop layer that WASM presents.
IBM and Unisys almost since the 1960's, depending on which model we are talking about.
I don't understand why you use a framework instead of a language there, but it seems to be in the same category of mistake as asking “why <compilation target> and not <thing that can be compiled to that target>”. They aren't mutually exclusive alternatives.
Losing Flash's excellent authoring tools is still a hard blow though.
.NET Core started as the Silverlight runtime, didn't it?
The article expressly stated that was not the exciting part, for them.
This is another iteration of the same old byte code blah blah, and each iteration has gotten better, and this is the best yet. Maybe.
Yeah, if you squint hard enough, everything new is just the reinvention of the wheel [4]. And yet – sometimes small, incremental improvements are what it takes to push a concept (steam powered machines, or bytecode for execution in the browser) from niche applications to being a breakthrough technology. I don't know if WebAssembly will be that incremental improvement, but claiming that it won't because Java tried and failed is a lazy, fallacious argument.
[1] https://en.wikipedia.org/wiki/Watt_steam_engine
[2] https://en.wikipedia.org/wiki/Newcomen_atmospheric_engine
[3] https://en.wikipedia.org/wiki/Aeolipile
[4] Speaking of reinventing the wheel: Those radial tires, eh, who needs them? They're basically just like cross ply tires. Not to mention the spoked wooden wheels that have been around since forever.
Like C and O are both chemical elements, so basically interchangeable, or like horse carriages and oil tankers are both methods of transporting things.
Provide relatively efficient support for languages other than JavaScript that is reliably available in major browsers without user action, an insecure plugin model, etc.
What killed Java was to a large part loading times. First the Plugin had to load, then the bytecode had to be run. On many systems one immediately knew when Java was used by the browser getting slow and sleeping for a while.
Flash loaded a lot faster (also systems were better, generally) however Flash apps completely messed with user experience.
Nowadays JavaScript can do a lot of things better (say changing URL, history support, back button) which can be integrated with a wasm tool for having a way more seamless integration.
As a user you simply don't notice if something is using JS or wasm.
From there it imo carries over to the server side and other places. Java simply got a bad reputation as resource hog used for bad UI in Applets and many people looked elsewhere.
And then wasm supports C and C++ (and more) with huge eco system of libraries, applications, ... (While of course these days a Java VM (incl. Android) is often used with non-Java languages as well)
But also, that it's more for non-GC languages.
I'm not 100% certain the W3C working group won't end up fumbling it, but if you're not excited about wasm then you probably just don't know much about it.
As for Docker, it is basically Java Application Servers full with YAML spaghetti to the point it makes me miss Websphere 5.
Or even better, mainframe and microcomputers language environments like on IBM i, z/OS and Unisys ClearPath.
Maybe its founders should have learned what preceded it.
If anything, Java is a much much safer bet than the oligopoly of WebKit/Blink.
Everything before it eventually let you have full access to the host file system, if you asked nicely, were given permission, or leveraged a bug in the system.
"The Security Risk of Lacking Compiler Protection in WebAssembly"
Wasm also has the ability to stream bytecode and validate/compile as it streams (fast parsing was a major design goal) resulting in much faster startup times.
Wasm is easier to integrate into the JIT/VM already shipping in browsers so they don't have to ship two massive engines.
Wasm is a bit lower level which should result in faster execution than the JVM in the future.
Wasm doesn't require garbage collection.
Wasm has unsigned integers.
Wasm isn't encumbered by Oracle.
Really? Is that a question?
The trend over the years has been to structure our code. GOTO throws all of that away. Jump straight over the guards.
At the bytecode level, all structured constructs get compiled into forms that rely on goto statements. Is this inherently insecure? Should the bytecode require structured programming too? How does this guard against malicious use any more than verified bytecode that relies on gotos?
But not really in high level languages
That's the most important reason to use WebAssembly instead of Java.
It's also nice that it can do all kinds of things Java can't, but that's just icing on the cake.
The project began in 1991 targeting set-top boxes. [source](https://web.archive.org/web/20100210225651/http://www.java.c...)
WASM is another iteration of the same noble idea done with different technologies at a different moment.
Java and the JVM have been incredibly successful. WASM has the potential to bring the dream of a universal binary even farther.
Never heard of UCSD Pascal?
I wish browser makers would focus into making the browser user and development experience actually work instead of going after the latest shiny feature.
How about not relying on the JRE? Mobile support? Partitioning between applet world and JS world?
Browsers would include a JRE (which they actually did at a time as well, but that’s just a tiny technicality either way), there wasn’t even mobiles capable of browsing the net at the time, but there is nothing inherently unsolvable, it’s not like there is no partitioning between wasm and js world, but in this alternative reality there wouldn’t be js. Java could have access to the DOM.
WebAssembly doesn't have this problem: almost every user is already running a browser that supports it.