Google, Microsoft, Mozilla team up for WebAssembly binary format for the web

In a bid to lower parsing time for web applications, a W3C community group has created a new compilation target for web browsers.

Before much of the web could experience the benefits of asm.js, a group of engineers from Microsoft, Google, and Mozilla are already planning its successor, named WebAssembly.

The reason for creating a binary format was to tackle the bottleneck in JavaScript execution, the parser.

"asm.js is great, but once engines optimize for it, the parser becomes the hot spot -- very hot on mobile devices. Transport compression is required and saves bandwidth, but decompression before parsing hurts," JavaScript creator and former Mozilla CEO Brendan Eich said in a blog post announcing WebAssembly.

"No, JS isn't going away in any foreseeable future. Yes, wasm [WebAssembly] should relieve JS from having to serve two masters. This is a win-win plan."

WebAssembly claims in its FAQ that the binary format under consideration can be natively decoded more than 20 times faster than JavaScript can be parsed.

Initially, WebAssembly will be converted to JavaScript via a polyfill in order to run, and be targeted only at C and C++. Once a minimal viable product is created, it is expected that support for other languages and compilers will be added, and features beyond those in JavaScript or asm.js can be added.

WebAssembly has provided a list of use cases for the format, with its use beyond web browsers targeted in the future.

Although it is a binary format, WebAssembly will have a text format to allow for wasm code to be readable when a user views a web page's source in their browser.

"Bottom line: With co-evolution of JS and wasm, in a few years, I believe all the top browsers will sport JS engines that have become truly polyglot virtual machines," Eich said. "I predict that JS over the same time span will endure and evolve to absorb more APIs and hardware-based affordances -- but not all, where wasm carries the weight."