An overview to WASM
WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine.
I'm glad to see you here.
In today's article, we will take a look into the concepts of
web assembly And, I will walk you through the initial setup for configuring your working environment for
web assembly development.
Before starting, Let me answer some of the questions.
WebAssembly is a new type of code that can be run in modern browsers, which brings new features and significant improvements to performance.
Well, it's not intended to write the whole assembly code by hand. It is designed to be an effective compilation target for source languages like C/C++, rust, etc.
Web assembly allows developers to run code written in several programming languages on the web, at near-native speeds while leveraging hardware capabilities that are common to most platforms.
A web platform has two parts:
- A set of Web APIs that the Web app can call to control web browser/device functionality and make things happen. (DOM, CSSOM, WebGL, IndexedDB, Web Audio API, etc.).
Performance intensive web app examples, 3D games, Virtual and Augmented Reality, computer vision, image/video editing, and serveral other domains that demand native performance.
WebAssembly is a low-level assembly-like language. And it has a compact binary format that runs with near-native performance.
Right now, you must be thinking, how do both languages work together?
Now that we are clear why, how, what is Web Assembly. Let's dig into
By the way, what are these?
It represents a WebAssembly library that has been compiled by the browser into executable machine code. And that's pretty much it.
It is an ArrayBuffer that contains the linear array of bytes read and are written by the low-level memory instruction.
This is a kind of technical definition of memory. That's it. Nothing much to worry about.
If you're familiar with C++, imagine this as a Vector. Which is also known as a resizable array. That's it!
It's a resizable array too, but it stores the references.
References of what??
JS Functions, etc. For safety and portability reasons.
It's a module that is paired with all the states, including Memory, table, and set of imported values.
These were some definitions or concepts in the sense which are required when dealing with WASM.
Above we talked about the raw primitives that WebAssembly adds to the Web platform: a binary format for code and APIs for loading and running this binary code.
In my next article on WASM, I will walk you through using WASM in your application.
Excited to learn?
Feel free to sign up for my newsletter. I'm not regular currently for writing articles due to my pathetic timetable. But I will try to publish new Articles Every Week from now.
Cya, Happy Learning 😄