...

/

Converting WAST into WASM

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:

  1. Create a new folder called wabt-playground and go into the folder:

Press + to interact
mkdir wabt-playground
cd wabt-playground
  1. Create a .wat file called add.wat:

Press + to interact
touch add.wat
  1. Add the following contents to add.wat:

Press + to interact
(module
(func $add (param $lhs i32) (param $rhs i32) (result i32)
local.get $lhs
local.get $rhs
i32.add
)
)
    ...