Technology companies and engineers have teamed up to push JavaScript aside and make room for a new binary syntax. Google, Microsoft, Mozilla and WebKit engineers have announced they are working on WebAssembly, a new binary format for low-level safe code.
“It’s by now a cliché that JavaScript has become the assembly language of the Web,” wrote Brendan Eich, JavaScript’s creator and former Mozilla CEO, on his blog. “Rather, JavaScript is one syntax for a portable and safe machine language, let’s say. Today I’m pleased to announce that cross-browser work has begun on WebAssembly, a new intermediate representation for safe code on the Web.”
According to Eich, while asm.js has worked well, the parser is a problem. “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,” he wrote.
(Related: The future of JavaScript)
Initially, WebAssembly will work just like asm.js. But once browsers support WebAssembly, the two will be able to diverge. Eich noted that JavaScript isn’t going anywhere anytime soon, and WebAssembly will free the language from “having to serve two masters.”
According to its GitHub page, WebAssembly seeks to do the following:
- “Define a portable, size- and load-time-efficient binary format to serve as a compilation target which can be compiled to execute at native speed by taking advantage of common hardware capabilities available on a wide range of platforms, including mobile and IoT
- Design to execute within and integrate well with the existing Web platform
- Design to support non-browser embeddings
- Make a great platform.”
“We’re pretty early into the overall process: There is no draft spec or even final formal standards body chosen, just a W3C Community Group, some initial prototyping, and early cross-browser consensus on the high-level design documents,” wrote Luke Wagner, a programmer at Mozilla, in a blog post. “Going forward, there will be a lot more iteration and experimentation under the WebAssembly GitHub organization.”