After many months of development, version 1.0 of WebAssembly (wasm for friends), is here.
WHAT IS WASM?
It all started with Emscripten which allowed C++ coding inside the browser although the code created was still quite slow compared to the native code.
Wasm gives a massive boost to web performances: it creates a multi-platform code which can easily compete on how the native code performs.
WebAssembly can be defined as a compilation target as its developers write code in any given language which is then translated into WebAssembly byte-code.
It now works on browsers but, in a near future, it could easily work on mobile operating systems such as ChromeOs and WebOs on top of servers and desktop apps.
Another future development could be in the 3D app domain since GPU is used and there is a need for high level features.
WebAssembly could have a really bright future in the following domains:
- high performance and pre-existing code, to be added to a web app
- the porting of desktop apps on the web, such as Autocad and 3D Unity (only to quote a few), already use Webassembly for their web-based products.
Languages that can be written in WebAssembly are Rust, C/C++, Kotlin/Native, Go and D.
There are some third party tools that allow .Net and Java to write on bytecode and wasm.
For languages such as Python and Ruby there are written interpreters in WebAssembly which help the correct functionality.
Rust is the language that has the best support as it is a Mozilla product.
The latest WebAssembly features can be tested using Firefox Developer Edition.
WHAT DOES THE FUTURE HOLD? TE INTERNET NATIVE APLICATIONS
WebAssembly and other technologies such as WebWorkers, IndexDB and new protocols such as HTTP/2 and QUIC allow us to start traveling through unexplored areas: the Internet Native Applications.
These are web applications with the same performance of native apps: you basically get the best out of each side.
The website “Can I use” explains that, since March 2018, 72.75% of global browsers have been supporting WebAssembly.
WEBASSEMBLY’S NEXT STEPS
Mozilla, which is actively involved in its development, mentioned the following evolution of WebAssembly:
- Multithreading (to best take advantage of multi-core processors)
- Simd (a technique to process data simultaneously by dividing them into sections and then execute the same function from different processes at the same time. It is a very similar concept to map/reduce)
- 64-bit wasm
- Streaming compilation (immediate code compilation whilst we are still downloading it)
- Tiered compilation (a second code compilation once the whole code has been downloaded – very performant but very slow.)
- Implicit HTTP caching
- Js and wasm fast interaction
- Fast data exchange between js and wasm
- ES modules integration (to import new wasm modules as if they were js)
WebAssembly clearly is a promising technology which opens new unimaginable scenarios. It will transform how web and apps are developed. We are currently evaluating it here at Interlogica with great attention for the next challenges.