WebAssembly (wasm) is different to other web APIs you might have played with. It’s a standard that defines a binary executable format for client-side applications on the web, which can be run in the browser while taking advantage of the speed and low-level hardware capabilities of machine code. While it’s a relatively new standard only now gaining attention, it’s already supported in all major browsers, and has a budding ecosystem of tools.
In essence, if you write a wasm module, you compile it to a bytecode format, which can be executed on any platform that supports WebAssembly. This is similar to Java bytecode running on the JVM. You wouldn’t typically expect to write wasm code directly.
There’s support available for Rust (opens in new tab), another language developed by Mozilla. However, it’s also expected that a wide range of languages and compilers will become available, and it will at some point introduce support for garbage-collected languages such as Java. You’ll find experimental compilers for other languages starting to become available.
As a result, one of the early emerging practical-use cases for WebAssembly is games developers looking to produce high-end games that run in browser. Epic Games has demonstrated a version of the Unreal Engine that runs in-browser as a wasm module.
Also, there’s nothing constraining WebAssembly to run only in-browser, and it’s expected it will be ported to other platforms. This could make it significantly easier to build cross-platform apps that support web and native environments.
If you want to get started with WebAssembly, Emscripten (opens in new tab) is a compiler that supports C and C++ compilation and conversion of existing applications. You won’t find too many production applications using it yet, but it represents another step to bridging the gap between browser and native software. This is definitely one to keep an eye on, and if you’re not building wasm modules, you could well be consuming them soon.
Building a site with a team? Keep your design files and notes safe in shared cloud storage.
Web design event Generate London (opens in new tab) returns on 19-21 September 2018, offering a packed schedule of industry-leading speakers, a full day of workshops and valuable networking opportunities – don’t miss it. Get your Generate ticket now (opens in new tab).