Goals of WebAssembly
WebAssembly started out with simple goals, including support for C/C++ conversion (with other languages coming along later). The developers knew they’d need a polyfill to get around the issue of browsers not supporting WebAssembly natively at the start.
The binary format allows WebAssembly programs to execute very efficiently, but you’re also able to write WebAssembly in text (in .wasm files) and view the source of a WebAssembly module in a browser. (See the FAQ for better detail.)
Creating for WebAssembly depends on tools such as Emscriptem and LLVM to convert C/C++. (Developers can switch from binary format to text and vice versa without losses.) Compilers for languages that target WebAssembly (C/C++, Rust, Go, C#) will eventually run in WebAssembly themselves, by emitting a WebAssembly module that a system can run. These will not be developed, however, until WebAssembly reaches its Minimum Viable Product stage.
WebAssembly code is represented as an abstract syntax tree made up of statements and expressions. Each function body consists of exactly one statement. All expressions and operations are typed, with no implicit conversions or overloading rules. Wasm instructions will operate on native machine types such as 32-bit integers, enabling efficient compilation.
Not Just for Browsers
WebAssembly’s creators don’t want it used just for desktop and laptop browsers; they also want it on mobile devices and Internet of Things hardware. In theory, WebAssembly’s intermediate representation (IR) should support both Just-in-Time and Ahead-of-Time compilation, making it potentially suitable for iOS as well as Android development.
How long until the first WebAssembly App reaches the App store? A finger-in-the-air guesstimate puts it at 18 months. There’s a whole lot of tooling needed, but with the combined resources (especially from Apple), don’t rule it out.
It’s still early days for WebAssembly but it could prove a powerful new tool for developers. There’s an informal WebAssembly Community Group on W3C that’s open to all (but you will need a W3C account to join); if you’re interested, check it out.