Have you heard the news about WebAssembly? Google, Microsoft, Mozilla and others are teaming up for launching a new binary format for the web.
We at Usersnap took a closer look on what WebAssembly is and why it’s appearance and future development should matter to everyone! Even if you’re not a developer!
It will change the web. At least to some extent.
The web is based on many standards which is absolutely fine. And it makes the life of builders and creators easier. Imagine there wouldn’t be any rule, language, framework, concept on which we build websites and applications.
So, what the heck is WebAssembly?
WebAssembly is kind of a new byte code. WebAssembly – or short: “wasm” – is a new binary syntax for low-level safe code. It defines a “portable, size- and load-time-efficient format and execution model” designed to serve as a compilation target for the web.
This definitely means performance improvements in the browser. And it gives us access to a set of low-level building blocks, such as a range of types and operations.
And as Bjarne Stroustup stated:
JS will survive. “There are only two kinds of languages: the ones people complain about and the ones nobody uses.” Bjarne Stroustrup #js
— Eric Elliott (@_ericelliott) June 19, 2015
Or as Eric Elliott stated:” It may be useful not to think of WebAssembly as a language at all. It’s more like a machine”
From asm.js to WebAssembly?
It has some advantages over asm.js which involve mainly performance issues. According to the FAQ: “On mobile, large compiled codes can easily take 20-40s just to parse […] First experiments show that WebAssembly can be loaded more than 20 times faster because the work for parsing is minimal.”
What’s so great about this at all?
This could bring “app-like performance” to all web content and web apps. Sounds great, huh? 😉
Instead of having to parse the full code, which can often take quite a while, it can be decoded significantly faster.
Make sure to check out this talk by Brendan Eich:
Who’s already on it?
Google, Microsoft, and Mozilla are just a few names. Leading engineers have launched a WebAssembly Community Group with its mission to “promote early-stage cross-browser collaboration on new, portable […] format suitable for compilation on the web.”
However, it must be stated that work “has just begun”. So it’s pretty early-stage and it will definitely take some time until WebAssembly will become something like a well-known web standard.
Why it affects every web developer?
The W3C WebAssembly Community group named quite a few use cases for using WebAssembly and how it will make life easier for web developers. Here are just a few:
- Better execution of programming languages that are cross-compiled to the web
- for developer tooling inside the browser
- faster client for enterprise applications (e.g. databases)
Less code, better performance, less bugs?
According to the WebAssembly group, WebAssembly means less source code. Compared to asm.js it means a reduction of about 25% in code size. Though this is just a prototype and results vary.
So you’re probably wondering how to keep up-to-date on WebAssembly? I’d recommend the following useful WebAssembly resources:
- GitHub page of WebAssembly
- Design documentation of WebAssembly
- W3C WebAssembly Community Group
- What is WebAssembly by Eric Elliott
Update: Experimental Support for WebAssembly in V8
You can also turn on the WebAssembly feature under chrome://flags#enable-webassembly in Chrome Canary 51.0.2677.0 or greater. For further information, I recommend to check out this blog post announcing the experimental support for WebAssembly.
Update: One year after the initial release of WebAssembly
About one year ago (yep – it’s already been a year), WebAssembly was released to the public. A lot of things happened ever since and people started experimenting with WebAssembly. As we’ve been a keen observer of WebAssembly, we’re happy to see the progress which has been made. According to an official blog post, the WebAssembly initiative made the following progress:
- a description and rationale of the initial feature set and planned future features;
- a specification and reference interpreter;
- 13,000 lines of tests used to validate both the spec interpreter and browsers;
- a first draft of the binary format.
The progress seems promising and browsers are trying to offer early WebAssembly implementations in their browser engine. It’s now possible to build WebAssembly demos.
If you found this post interesting, follow us on twitter where we tweet about web development, web design and startups.
This article was brought to you by Usersnap – a visual bug tracking and screenshot tool for every web project.