WebAssembly


First released in the spring of 2017, WebAssembly (Wasm) is a new portable binary-code format aimed at high-performance web applications. Interestingly, web assembly is designed as an open standard so it may be supported by any language and operating system. Currently, Rust is able to compile directly to web assembly through its cargo toolchain and C/C++ can be compiled to wasm through the Emscripten compiler though many languages provide some level of support for wasm.

Historically, JavaScript has been the language of choice for all things web. While JavaScript’s weak, dynamic typing provides high writability, the language suffers many shortcomings that seemingly are only accepted because of its ubiquitousness in the browser. A lack of typing leads to poor readability, meme-worthy bugs from things like type coercion, and high levels of strain on clients as Node doesn’t provide basic things like multi-threading.

While WebAssembly isn’t necessarily designed to replace JavaScript, it does promise greatly increased performance. As web applications grow in complexity and code execution is increasingly moved from the server to the client, web assembly aims to bring the performance of systems programming languages to the browser. Future versions of wasm promise multi-threading and garbage collection meaning it could become a compilation target for widely used languages like Python.

WebAssembly doesn’t come without compromises, however. The language does offer performance improvements and decreased computation time but web assembly has no ability to directly manipulate the Document Object Model (DOM) and must rely on a JavaScript API for all changes there.

WebAssembly is quickly evolving and has made its way into interesting use cases such as video streaming clients. As wasm becomes more developer friendly and teams recognize the performance that can be gained moving away from Node, I believe we will see wasm become more and more pervasive in the web application world.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *