A primer on WebAssembly

Click for: original source

To understand why there was a requirement for WebAssembly, let’s take a not-so-quick stroll down memory lane. And why it hasn’t replaced Javascript yet. By Divya Mohan.

So what exactly is WebAssembly? It is a binary instruction format for stack based machines.It is closer to machine code than either asm.js or JavaScript. Therefore, it is a no-brainer that decoding, compiling, fetching, and optimizing WebAssembly code takes lesser time. Why?

The guide then explains:

  • History of the WWW
  • Enter JavaScript
  • asm.js
  • Enter WebAssembly

Introduced as a subset of JavaScript, the asm.js specification aimed at describing a sandboxed virtual machine for memory-unsafe languages like C or C++ and provide a low-level, efficient target language for compilers. Implemented first by the Mozilla Firefox browser, this spec introduced performance improvements via employment of ahead-of-time optimizing compilation strategy for valid asm.js code by the JavaScript engines.

WebAssembly, abbreviated Wasm, was designed to be a portable compilation target for programming languages, enabling deployment on the web for client and server applications.

WebAssembly, abbreviated Wasm, was designed to be a portable compilation target for programming languages, enabling deployment on the web for client and server applications. Good read!

[Read More]

Tags web-development javascript open-source app-development