WebAssembly Is Ready For Use
Written by Ian Elliot   
Wednesday, 01 March 2017

WebAssembly is possibly the most exciting development in any area of programming at the moment and it has just reached an important milestone - consensus.

WebAssembly (WASM) is a low-level intermediate language that can be processed by the JavaScript engine alongside JavaScript. The advantage of WASM is that it is a much lower level representation of the program than the equivalent JavaScript. This makes it possible for the engine to run the code much faster than the more sophisticated and expressive JavaScript. The limited range of expression that WASM allows probably means that you aren't going to be writing directly to it. Instead the idea is that a compiler will produce WASM from other langauges. 

WASM has been progressing steadily but this week the "WebAssembly stakeholders" have agreed that it is time to end the browser preview phase and declare the WASM API and binary format complete for initial implementation. What this means is that we can now move forward to browsers coming with WASM support by default. 

WebAssembly CG members representing four browsers, Chrome, Edge, Firefox, and WebKit, have reached consensus that the design of the initial (MVP [1]) WebAssembly API and binary format is complete to the extent that no further design work is possible without implementation experience and significant usage. This marks the end of the Browser Preview and signals that browsers can begin shipping WebAssembly on-by-default. From this point forward, future features will be designed to ensure backwards compatibility.


This doesn't mean everything is done and dusted as there is still a lot of work left unfinished. What we currently have is a basic toolchain in the form of the Emscripten compiler. This means you can program in C/C++, which isn't the widest choice in the world. There are also lots of omissions from the representation - no native strings, no exception handling and so on. These things can be emulated within the basic WASM but the resulting code tends to be slow. 

The next step is for a W3C working group to be formed to complete the formal specification. The community have also decided on the WASM logo:

wasmIcon2017

 

A cute feature of the logo is that the notch in the top enables it to connect with the JavaScript logo:

jswasm

 

This brings us to a key point - is WASM a JavaScript killer?

Early stage adopters of WASM are going to use it because of the speed advantages it offers, and its ability to port existing programs to the web, rather than as a rejection of JavaScript. As we move on, however, it should be possible to write in whatever language you like, compile it to WASM, and run it in any browser. This is seen by many as a future world in which JavaScript no longer rules the web. 

Is this likely? 

There is a great deal of investment in JavaScript and WASM is designed to run on the same engine that runs it, so it isn't going to be disadvantaged by the adoption of WASM. At the moment WASM still needs JavaScript to do things like interact with DOM and this makes it a partnership. If  a JavaScriptless future is going to be a reality then WASM has to be expanded a lot, and this might not happen if interworking with JavaScript is a cheaper option.

It really might turn out to be a partnership rather than a takeover. 

  • Ian Elliot is the author of the newly published  Just jQuery: The Core UI (I/O Press) 

More Information

WebAssembly consensus and end of Browser Preview

Related Articles

WebAssemby Another Milestone 

WebAssembly Takes A Big Step Towards Being Real 

Progress On WebAssembly 

WebAssembly Has Mozilla, Microsoft,Apple and Google Backing It 

Asm.js Goes All Edgy 

Support For Asm.js Growing?       

Mozilla Enhances Browser-Based Gaming       

WebKit JavaScript Goes Faster Thanks To LLVM       

Firefox Runs JavaScript Games At Native Speed  

Asm.js Gets Faster       

Java, ASM.js Or Native - Which Is Faster?       

JavaScript Assembly Language  

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


CSS Test of Time Award 2023
18/02/2024

The ACM CCS Test-of-Time Award honors research with long-lasting influence, which have had significant impacts on systems security and privacy. The 2023 award in respect of a paper by Marten van Dijk  [ ... ]



Couchbase's Coding Assistant Goes GA
11/03/2024

Capella iQ, the AI coding assistant for developers that makes interacting with Couchbase using natural language possible, has gone from private beta to being generally available.


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN: 1871962501>

 

 

Last Updated ( Tuesday, 14 March 2017 )