What’s next for WebAssembly portable code
If its roadmap holds, WebAssembly, the binary format to speed the performance of web applications on both computers and mobile devices, will improve its language support via garbage collection, threads, better debugging, and a SIMD (single instruction, multiple data) extension.
WebAssembly’s working drafts published
- “WebAssembly Core Specification,” which describes Version 1.0 of the standard, providing a safe, portable, low-code format geared to compact representation and efficient execution. The proposal notes goals of WebAssembly that include enabling high-performance web applications. WebAssembly code is intended to be easily inspected and debugged. The technology is structured around concepts including basic value types and a stack machine computational model. Code is organized into separate functions. Also noted in the specification are intentions to be hardware-, language-, and platform-independent.
<script type= ‘module' >tag and any other web API loading ECMAScript 6 modules via a URL as part of ECMAScript 6 module integration.
- “WebAssembly Web API,” which describes the integration of WebAssembly with the broader web platform. The proposal covers aspects such as streaming module compilation and instantiation and developer-facing display conventions.
New features planned for WebAssembly
WebAssembly garbage collection proposed
To support use of multiple languages with WebAssembly, garbage collection is needed to efficiently allocate and manipulate managed objects from WebAssembly code, said Deepti Gandluri, a Google Chrome software engineer on the WebAssembly team. Garbage collection currently is in the proposal stage of the WebAssembly roadmap.
WebAssembly thread support is coming soon
A trial version of threads is due by 2018, with the general release to be launched by July 2018, Gandluri said. The use of threads will simplify the porting of multithreaded applications to the web, and lay the groundwork for faster-running applications.
WebAssembly debugging enhancements under development
To improve debugging, the WebAssembly developers are working on capabilities for source maps and memory inspection. WebAssembly currently offers basic debugging capabilities. With the planned SIMD extension, WebAssembly will gain support for instructions used in image and video processing and cryptography.
Also on the roadmap is “zero-cost” exception-handling for C/C++ to eliminate overhead.
WebAssembly will gain more language support
It is technically possible now to use other languages with WebAssembly, and there have been experimental implementations to work with the format. However, these languages cannot currently achieve the ideal performance, memory utilization, or DOM integration, said Luke Wagner, a Mozilla engineer on the WebAssembly team.
As a result, WebAssembly will likely be enhanced to support languages using higher level garbage collection, such as Java, C#, and Python. But it could take a couple years to accomplish this.
How browser vendors support WebAssembly
WebAssembly is available for the current versions of all four major browser: Apple Safari, Google Chrome, Microsoft Edge, and Mozilla Firefox.
Google has released a 3D library called Draco that uses WebAssembly. Used for compressing and decompressing 3D geometric meshes and clouds, Draco features a WebAssembly decoder for better performance.