WebAssembly — powerful performance for the web

If you’ve ever begun a lesson on computer programming and programming languages, you’ve probably heard of the term high level and low level languages. And you most likely have been told that high level languages are ones which are read, interpreted, and make more sense on a human level of thinking, while low level languages are closer to computer level processing. Essentially, to sum it up all neat and tidy, lower level languages more closely resemble the instructions which actual computer chips read and execute, while higher level languages contain more abstractions for human use.

It makes sense, then, that while higher level languages are more efficient for human uses, such as development and maintenance, the lower level languages will be much faster for computer uses, a.k.a reading and executing instructions. Thus, the beauty and appeal of compiled code, especially mature complied languages, which have refined compilation methods to create fast and efficient machine code from their high level form.

However, on the web dominated by browsers running javascript, accessing these performance gains is a problem. And, from this problem, eventually rose WebAssembly.

As you might have already guessed, WebAssembly is a low-level, assembly-like language which can be run by browsers on the web. It is implemented in a binary format which can be easily interpreted by machines, but it was developed to work with and alongside javascript, the de facto language of the web.

WebAssembly provides a few amazing features which makes web development more powerful and awesome than ever before:

  1. It provides a machine-level target format for languages with lower level memory models such as C/C++ to compile to.
  2. It provides a language to directly create web assembly programs.
  3. While it cannot directly access the DOM and other web features, it provides an easy to use Javascript API so that programs in either language and call and use the other.

What these mean, is that, for one, programmers can create very fast and powerful, large scale codebases with comparable speeds to those executed directly from a machine. They can also port C/C++ programs to javascript and web browsers. And in the future, web assembly aims to be able to compile more languages to its .wasm format beginning with the likes of Java.

The best part is that it is well supported by browsers and well documented by Mozilla so you can check it out and begin using it right away!