wat2wasm
Assemble WebAssembly text to binary
TLDR
Compile WAT to WASM
SYNOPSIS
wat2wasm [-o output] [-v] [options] input
DESCRIPTION
wat2wasm is an assembler from the WABT (WebAssembly Binary Toolkit) that compiles WebAssembly Text Format (WAT) files into binary WebAssembly (.wasm) modules. It is the counterpart to wasm2wat, which performs the reverse conversion.
The tool validates the input WAT source against the WebAssembly specification during compilation, reporting syntax and type errors before producing output. A validate-only mode can check files without generating binary output, which is useful in build pipelines.
The --debug-names option embeds function and variable names from the WAT source into the binary as custom sections, making the output easier to debug in browsers and other tools that display named symbols.
PARAMETERS
-o FILE
Output file.-v
Verbose.--validate
Validate only.--debug-names
Include debug names.--help
Show help.
CAVEATS
WAT syntax required. Part of WABT. Strict validation.
HISTORY
wat2wasm is part of WABT (WebAssembly Binary Toolkit), compiling WAT text format to binary WASM.
SEE ALSO
wasm2wat(1), wasm-opt(1), wasm-validate(1)
