days
1
4
hours
0
8
minutes
4
6
seconds
1
3
search
With our powers combined

Mozilla, Microsoft and Google form WebAssembly, a new binary web format

Natali Vlatko
Teamwork image via Shutterstock

Ladies and gentlemen, please welcome WebAssembly – a major new project housing a portable bytecode that claims to be super speedy for browsers and provides a more efficient target for compilers than JavaScript.

Developers from Microsoft, Google and Mozilla are collaborating on a project known as WebAssembly, which aims to become a new intermediate representation for safe code on the Web.

Developers from WebKit are also along for the ride, but the announcement of a cooperation between the three major browser companies has attracted the biggest chunk of attention. The news has been sparking hopes that the end product will eventuate in cross-browser compatibility and adoption.

Behind the bytecode

Unveiled by Luke Wagner and Brendan Eich respectively, the new Web standard will define a “portable, size- and load-time-efficient format and execution model specifically designed to serve as a compilation target for the Web”. Wagner went on to state:

As reflected in the high-level goals, a central requirement for WebAssembly is that it integrate well with the rest of the Web platform and that the initial version run efficiently on current browsers using a client-side polyfill. As demonstrated, the polyfill can leverage asm.js to get great performance.

The arrival of a binary format and WebAssembly hopes to tackle the parser problem that developers experience with JavaScript execution. In their online FAQ, the team behind the project claim that “the kind of binary format being considered for WebAssembly can be natively decoded much faster than JS can be parsed” (estimates are putting that figure at around the 20x faster mark).

Mobile developers stand to reap massive rewards from such a performance boost, as the introduction of native decoding is “critical to providing a good cold-load user experience”.

Having Eich on board, the creator of JavaScript itself, is quite the coup. In his own post unveiling the new project, he highlighted the necessity of “wasm” (WebAssembly for short) and asm.js to initially co-exist, while the long-term strategy allows wasm to “diverge from JS’s semantics, in order to best serve as common object-level format for multiple source-level programming languages”.

This remains crucial even as JS and asm.js evolve to sprout shared memory threads and SIMD support. Examples of possible longer-term divergence: zero-cost exceptions, dynamic linking, call/cc. Yes, we are aiming to develop the Web’s polyglot-programming-language object-file format.

Wagner shares the “play nice with JS” philosophy, saying it was natural to view WebAssembly as “the next evolutionary step of asm.js”.

It has long irked the developer community that JavaScript eventually came out on top as the dominant Web language. The declaration of WebAssembly has been met with many calls for the long-awaited usurping of JavaScript’s rule:

WebAssembly can be investigated further over on GitHub.

Author
Natali Vlatko
An Australian who calls Berlin home, via a two year love affair with Singapore. Natali was an Editorial Assistant for JAXenter.com (S&S Media Group).

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of