We will be using WebAssembly Explorer, that converts our C or C++ code and allows to download a .wasm file.
Once code is ready, click the button “Compile” in the left-most bar. In the compiler, the middle column contains human-readable version of the .wasm binary code, known as WebAssembly Text Format (WAT).The right column shows the assembly code.
The WAT helps us understand how the compiler refers the function created and makes it more human readable.
The file created will have a section called “export” where function name will have “_Z3” prefix and “ii” suffix. We use this name to import the functions. These are added by the compiler for debugging purposes.
The middle WAT section features a download .wasm binary file option. We should create a directory and put the .wasm file in it as well as create two other files, namely,
../index.html and script.js(empty for now)<.p>
We include the .wasm as a module like a regular ES6 module
script type="‘module’"
Let's collaborate to turn your business challenges into AI-powered success stories.
Get Started