WebAssembly (short: wasm) is a new binary format for the web, created by Google, Microsoft, Mozilla and others. It will be used for performance critical code and to compile other languages (especially C/C++) to the web platform. It can be seen as a next step for asm.js .
WebAssembly: the next step for asm.js
Initially, WebAssembly is (roughly) a binary format for delivering asm.js code. The two main advantages of such a format are:
Faster loading. Especially with large code bases and mobile devices, parsing becomes a bottleneck: “On mobile, large compiled codes can easily take 20–40s just to parse” (WebAssembly FAQ). First experiments show that WebAssembly can be loaded more than 20 times faster, because the work for parsing is minimal.
xto a 32 bit float.
Math.imul(x,y)multiplies the two integers
The big picture
Performance critical functionality (games, video and image decoders, etc.) will be implemented via WebAssembly, either by hand-coding it or by yet-to-be-invented languages that are slightly higher-level.
External code bases, especially those in C/C++, will be easy to port to the web platform, via WebAssembly.
The initial focus is for WebAssembly to be a compilation target for C/C++. Longer term, more features supporting other languages will be added, including the ability to create garbage-collected data (currently, asm.js creates and manages its own heap).
What is different this time?
Why should WebAssembly succeed where previous attempts (such as Adobe Flash and Google Portable Native Client) have failed? There are three reasons:
First, this is a collaborative effort, no single company goes it alone. At the moment, the following projects are involved: Firefox, Chromium, Edge and WebKit.
A few more interesting tidbits
There will be a text format for WebAssembly. It will mirror the semantics of the binaries and contain a tree of statements and expressions.
- “WebAssembly” by Luke Wagner