Hello WebAssembly!

WebAssembly- Key Concepts

WebAssembly is basically a byte code that can be generated from various languages and then be compiled by the browser, in native speed.

For example: take a simple C program, compile it into a byte code written for a WASM virtual machine.

WASM- Web Assembly State Machine. This WASM virtual machine is very small, very portable and implemented in all major web browsers.

The main key concepts are as below:

Module

A module in WebAssembly regards an object that is compiled by the browser to an executable machine code. In other words- the .wasm file. A module can be shared between windows and also web workers.

Memory

Memory in WebAssembly means an arraybuffer which holds data for your program.

Table

Table in WebAssembly is a typed array which is outside the WebAssembly memory and mostly has a reference to functions. Meaning, it stores all memory addresses of functions.

Instance

Instance in WebAssembly refers to an object that will have all exported functions which can be called from javascript in order to execute inside the browser.

Compiling

After writing the source code, when compiling it- a binary WASM file will be created. This file needs to be included in the project.

For better understanding, get started in writing your first WASM file.

Key Concepts

One thought on “Hello WebAssembly!”

Leave a Reply

Your email address will not be published. Required fields are marked *