Browser vendors have made massive strides with JavaScript performance. Google kicked things off with its V8 engine, but since then, the likes of Mozilla and Microsoft have come back with snappy virtual machines of their own. But JavaScript can only take you so far. The next step is WebAssembly (wasm), which supports compilation from C/C++ and near-native performance in the browser. Both Chrome and Firefox now have wasm enabled by default.
Both Chrome 57 and Firefox 52 now come with WebAssembly enabled, allowing developers to compile applications from C or C++ (and tentatively Rust) for the web. If you’d like to see what’s possible, Mozilla has a few video available that explain and show off the platform.
WebAssembly is interoperable with JavaScript, so it’s not one or the other. That said, for high-performance applications, such as games, WebAssembly will be the way forward.
For example, Unity’s been building up support for wasm with its WebGL player, something it was forced to do when Chrome and other vendors started turning their backs on Flash and NPAPI (Netscape Plugin Application Programming Interface).
While you won’t see a mass adoption in the near future, developers are now in a position to dedicate serious resources to WebAssembly. And, once other languages are supported, like C#, the floodgates will very much be open.
Chrome Platform Status [Google]
Firefox 52: Introducing Web Assembly, CSS Grid and the Grid Inspector [Mozilla]
Comments
3 responses to “WebAssembly Arrives In Chrome And Firefox”
Is this different from asm.js?
Yes.
As I understand, it is currently similar to asm.js, even with similar performance, however a primary difference is that it is pre-compiled, arriving as a bitstream – in contrast to asm.js which arrives as text and must then be compiled. This removes a step that takes time, slowing down asm.js code.
Additionally there are further enhancements coming to webassembly allowing for super powers that asm.js won’t likely receive. Here’s a list of some of them:
https://github.com/WebAssembly/design/blob/master/FutureFeatures.md
(Some are definite, some are possible.)
Interesting. Half of it probably a bit beyond my comprehension/level of expertise 😛 But thanks!