WebAssembly format

WebAssembly supported by Mozilla

WebAssembly, or wasm, is the most significant new technology to come to the web platform in a decade.  Technically speaking, it is a new, low-level, assembly-like language that runs efficiently on the existing web platform and is backward-compatible with its precursor, asm.js. Most people, however, will use the wasm format as a compiler target, translating their applications into web-ready modules that can run in modern web browsers at near-native speeds.

How does it work?
WebAssembly delivers significant performance gains because modern browser engines can parse and execute its binary format an order of magnitude faster than JavaScript. So you can take C/C++ code, translate it into wasm using a compiler tool like Emscripten, and load the generated wasm module into a JavaScript app, where it will be safely and efficiently executed by the browser.

Why does it matter?
The wasm format makes it possible to support graphics-heavy games in a browser without plug-ins. It can be used to port scientific simulation and other compute-intensive applications to the web platform. It also has non-web applications such as the Internet of Things, mobile apps and JavaScript virtual machines.

What does it replace or change?

  • The wasm format removes the need for browser plug-ins to support online gaming.
  • It works alongside JavaScript, replacing asm.js as the compilation target for C/C++ applications.
  • It allows programmers to put large C/C++ applications on the web without rewriting them.

Is it a standard?
WebAssembly is an emerging standard, with ongoing work on the specification. The browser vendors have reached consensus on the design of the initial wasm API and binary format, and there is an active W3C Community Group with members from Mozilla, Microsoft, Google and Apple.

Which products support it?
Firefox and Chrome browsers currently support the wasm format on Linux, MacOS, Windows and Android. The latest versions of Edge and Safari now include WebAssembly support as well. Autodesk plans to support wasm and WebGL 2 in its Stingray v1.8 game engine. Other game engines and projects like the Rust language are adding experimental support.