Bongani  Ngema

Bongani Ngema


Rust on The Front-end

Up until now, JavaScript has been the only ubiquitous language available in browsers. It has made JavaScript much more popular than its design (and its associated flaws) would have allowed. Consequently:

  • The number of JavaScript developers has grown tremendously and steadily
  • The ecosystem around front-end JavaScript has become larger and much more complex
  • The pace of changes has increased, so that developers complain about JavaScript fatigue
  • Interestingly enough, JavaScript sneaked on the back-end via Node.js
  • etc.

I don’t want to start a holy war about the merits of JavaScript, but IMHO, it only survived this far because of its role in browsers. In particular, the current architecture that moves the responsibility of executing the code from the server to the client puts a lot of strain on the latter. There are not many ways to improve performance: either buy bigger client machines or make the JavaScript engines better.

Comes  WebAssembly.

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.

Wasm is not designed to fully replace JavaScript in the browser (yet?), but to improve the overall performance. While Rust is designed for system programming, it offers compilation to WebAssembly.

This is the 5th post in the Start Rust focus series. Other posts include:

  1. My first cup of Rust
  2. My second cup of Rust
  3. The Rustlings exercises — part 1
  4. The Rustlings exercises — part 2
  5. Rust on the front-end (this post)

#rust #beginner #webassembly

Rust on The Front-end