Was reading the MDN docs regarding Wasm. They used the term WASM module quite a few times. Their definition was the following:
A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, and instantiated multiple times. To instantiate the module, call the secondary overload of WebAssembly.instantiate().
I couldn't quite understand the meaning of this. Is a web assembly module simply a Wasm file or is it something else?
What is Web Assembly?
Web Assembly(Wasm) is a way of taking code written in programming languages other than JavaScript and running that code in the browser.
It is generated by the compiler with a binary format which allows us to execute any language code on the browser
How does it work?
Despite its name, WebAssembly is not quite an assembly language because it’s not meant for any specific machine. It’s for the browsers, and when you’re delivering code to be executed in the browser, you don’t know what kinds of machines will your code be running on.
What WebAssembly enables you to do is to take things like C, C++ or Rust code and compile it into what is called a WebAssembly module. You can load that into your web application and call it from JavaScript.
Wasm programs are deployed in two stages.
It’s not a replacement for JavaScript, it works alongside JavaScript.
Here is a great article to go more in details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With