...

/

Converting WASM into WAST

Converting WASM into WAST

Learn how to convert WASM into WAST using the wasm2wat command.

We'll cover the following...

Sometimes, for debugging or understanding, we need to know what the WASM is doing. WABT has a wasm2wat converter. It helps to convert WASM into WAST format:

Press + to interact
main.sh
add.wat
/path/to/build/directory/of/wabt/wasm2wat add.wasm

Running the previous command will convert add.wasm back into WAST format and print the output in the console.

If you want to save it as a file, you can do so by using the -o flag:

Press + to interact
main.sh
add.wat
/path/to/build/directory/of/wabt/wasm2wat add.wasm -o new_add.wat

This command creates a new_add.wat file.

To check the various options supported by wasm2wat, we can run the following command:

Press + to interact
/path/to/build/directory/of/wabt/wasm2wat --help

Note: ...