Monty  Boehm

Monty Boehm


What is WebAssembly and Why Does it Matter?

In the past few years, there has been a lot of talk about WebAssembly on the web and other areas. If you have not heard about it before, it is an Assembly like language. It can run almost anywhere, including the web, mobile, desktop, and on servers. Many languages support compiling to WebAssembly, such as C/C++ (Emscripten), Rust, and Go (TinyGo). Others have an interpreter/JIT Compiler that can be compiled to WebAssembly, like Python (Pyodide) and C#. It has many benefits for using on the web and in native code, which will be talked about later. First, let’s go over the history of WebAssembly and other things like that.

The history of sandboxed web runtimes

At the start of the web, Java was very popular and growing fast. To help people use Java and other languages on the web, browsers introduced Java Applets. Java Applets allowed people to use Java and other languages as scripting on the web. Because untrusted websites could run code, it was sandboxed, which means that it was isolated and secure. However, it required an external plugin outside of the browser and was heavy for small applications, so another language, built for the web called JavaScript, was made.

JavaScript rose in popularity as Java and Java Applets started declining. Eventually, because it was not integrated into the web very well and had many flaws, Java Applets were removed from most browsers. JavaScript rose to be the only language on the web, and while it worked well, it never had great support for coding with other languages and its performance was suboptimal.

In 2013, a new subset of JavaScript was created, designed so that it would run fast and be able to be used from a multitude of languages. It was called asm.js. Asm.js was a great experiment in implementing low-level assembly for the web, but some improvements could be made.

To fix some problems with asm.js, like faster parsing, WebAssembly was released in 2017. It quickly gained popularity and browser support. Currently, it is supported by Chrome, Edge, Firefox, Safari, and more.

#javascript #webassembly #web-development

What is WebAssembly and Why Does it Matter?