1WABT(1)                   BSD General Commands Manual                  WABT(1)
2

NAME

4     wat2wasm — translate from WebAssembly text format to the WebAssembly bi‐
5     nary format
6

SYNOPSIS

8     wat2wasm [options] file
9

DESCRIPTION

11     wat2wasm Read a file in the wasm text format, check it for errors, and
12     convert it to the wasm binary format.
13
14     The options are as follows:
15
16     --help  Print this help message
17
18     --version
19             Print version information
20
21     -v, --verbose
22             Use multiple times for more info
23
24     --debug-parser
25             Turn on debugging the parser of wat files
26
27     -d, --dump-module
28             Print a hexdump of the module to stdout
29
30     --enable-exceptions
31             Enable Experimental exception handling
32
33     --disable-mutable-globals
34             Disable Import/export mutable globals
35
36     --disable-saturating-float-to-int
37             Disable Saturating float-to-int operators
38
39     --disable-sign-extension
40             Disable Sign-extension operators
41
42     --disable-simd
43             Disable SIMD support
44
45     --enable-threads
46             Enable Threading support
47
48     --enable-function-references
49             Enable Typed function references
50
51     --disable-multi-value
52             Disable Multi-value
53
54     --enable-tail-call
55             Enable Tail-call support
56
57     --disable-bulk-memory
58             Disable Bulk-memory operations
59
60     --disable-reference-types
61             Disable Reference types (externref)
62
63     --enable-annotations
64             Enable Custom annotation syntax
65
66     --enable-code-metadata
67             Enable Code metadata
68
69     --enable-gc
70             Enable Garbage collection
71
72     --enable-memory64
73             Enable 64-bit memory
74
75     --enable-multi-memory
76             Enable Multi-memory
77
78     --enable-extended-const
79             Enable Extended constant expressions
80
81     --enable-all
82             Enable all features
83
84     -o, --output=FILE
85             Output wasm binary file. Use "-" to write to stdout.
86
87     -r, --relocatable
88             Create a relocatable wasm binary (suitable for linking with e.g.
89             lld)
90
91     --no-canonicalize-leb128s
92             Write all LEB128 sizes as 5-bytes instead of their minimal size
93
94     --debug-names
95             Write debug names to the generated binary file
96
97     --no-check
98             Don't check for invalid modules
99

EXAMPLES

101     Parse test.wat and write to .wasm binary file with the same name
102
103           $ wat2wasm test.wat
104
105     Parse test.wat and write to binary file test.wasm
106
107           $ wat2wasm test.wat -o test.wasm
108
109     Parse spec-test.wast, and write verbose output to stdout (including the
110     meaning of every byte)
111
112           $ wat2wasm spec-test.wast -v
113

SEE ALSO

115     wasm-decompile(1), wasm-interp(1), wasm-objdump(1), wasm-opcodecnt(1),
116     wasm-strip(1), wasm-validate(1), wasm2c(1), wasm2wat(1), wast2json(1),
117     wat-desugar(1), spectest-interp(1)
118

BUGS

120     If you find a bug, please report it at
121     https://github.com/WebAssembly/wabt/issues
122
123BSD                            February 8, 2023                            BSD
Impressum