WebAssembly

Mohd Irfan
2 min readNov 14, 2022

I was trying to understand this hot topic WebAssembly a while back and it took me a while to fully understand the entire journey. I had to go back to the start of programming languages and how they evolved.
Here is my summary ( might not be useful for now but could be a good to know thing )

Low-level programming languages are those that are close to the machine instruction set. They offer little or no abstraction from the hardware. A low-level programming language interacts with registers and memory directly. Because low-level language instructions are machine-dependent, programs written in LL are machine-dependent and are not portable.

High-level programming languages provide a higher level of abstraction than machine language. They do not interact with the hardware directly. They are more concerned with complex arithmetic operations, optimal program efficiency, and coding ease.

But HLL and LLL both alone could not be used to build the complicated software that are being developed today, so a hybrid approach was needed. And that’s how compilers and interpreters came in the picture.

This works great with native apps, but there is still only the Javascript that works properly inside the browser. There are some really complex tasks that are difficult to accomplish in browsers using javascript. For example -

  1. Image recognition,
  2. Computer-Aided Design (CAD) applications,
  3. Live video augmentation, VR and augmented reality,
  4. Scientific visualization and simulation,
  5. Games, Image/video editing, etc.

For javascript, the code gets downloaded, parsed, and converted to machine format. A lot of time goes into it and for heavy tasks, it can be slow.

WebAssembly is a new sort of programing language that can be run in modern web browsers. it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides HLL with a compilation target for web use.

It is also intended to run alongside JavaScript, allowing both to work together. But since it is still in development, organizations are using it as a compilation target of HLL rather than building their product from scratch in WebAssembly.
Figma, for example, is written in C++, and its C++ code gets compiled into WebAssembly.
https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/

--

--