Converting WAST into WASM
Learn how to convert WAST into WASM using the wat2wasm command.
We'll cover the following...
The wat2wsam
wat2wasm
helps to convert the WAST format into WASM. Let’s take it for a spin:
Create a new folder called
wabt-playground
and go into the folder:
Press + to interact
mkdir wabt-playgroundcd wabt-playground
Create a
.wat
file calledadd.wat
:
Press + to interact
touch add.wat
Add the following contents to
add.wat
:
Press + to interact
(module(func $add (param $lhs i32) (param $rhs i32) (result i32)local.get $lhslocal.get $rhsi32.add))