WABT(1)
πΈ WABT(1) β wat2wasm, bestie edition πΈ
okay so listen, this is the manual page for wat2wasm, which lives in the WABT (WebAssembly Binary Toolkit) family. She's the one who takes your cute little .wat text file and turns it into that crunchy .wasm binary. icon behavior honestly π
π NAME π
wat2wasm β translate from WebAssembly text format to the WebAssembly binary format. like, she reads the human-readable vibes and spits out the actual bytes. periodt.
β¨ SYNOPSIS β¨
wat2wasm [options] filename
π¦ DESCRIPTION π¦
wat2wasm reads a file in the wasm text format, checks it for errors (she's thorough, ngl), and converts it to the wasm binary format. it's giving "translator who actually knows what she's doing." π₯
The options are as follows:
--helpβ print this help message. your little cry for guidance? answered. π«Ά--versionβ print version information. identity check, slay.-v,--verboseβ use multiple times for more info. the more you stack it, the more she tells you. main character energy for your terminal π-d,--dump-moduleβ print a hexdump of the module to stdout. like a little x-ray of your binary, hex and all π--disable-exceptionsβ disable Experimental exception handling--disable-mutable-globalsβ disable Import/export mutable globals--disable-saturating-float-to-intβ disable Saturating float-to-int operators--disable-sign-extensionβ disable Sign-extension operators--disable-simdβ disable SIMD support--enable-threadsβ enable Threading support--enable-function-referencesβ enable Typed function references--disable-multi-valueβ disable Multi-value--disable-tail-callβ disable Tail-call support--disable-bulk-memoryβ disable Bulk-memory operations--disable-reference-typesβ disable Reference types (externref). yes, the literalexternrefstays untouched, i don't make the rules π--disable-annotationsβ disable Custom annotation syntax--enable-code-metadataβ enable Code metadata--enable-gcβ enable Garbage collection. she said clean up, bestie π§Ή--disable-memory64β disable 64-bit memory--disable-multi-memoryβ disable Multi-memory--disable-extended-constβ disable Extended constant expressions--disable-relaxed-simdβ disable Relaxed SIMD--enable-custom-page-sizesβ enable Custom page sizes--enable-compact-importsβ enable Compact import section--enable-wide-arithmeticβ enable Wide arithmetic--enable-allβ enable all features. the "i want everything on the menu" option, no cap π-o,--output=FILEβ output wasm binary file. use"-"to write to stdout. yes, literally the dash"-", don't get cute with it π-r,--relocatableβ create a relocatable wasm binary (suitable for linking with e.g.lld)--no-canonicalize-leb128sβ write all LEB128 sizes as 5-bytes instead of their minimal size. chunky on purpose, she said we're not minimizing today π€--debug-namesβ write debug names to the generated binary file. name tags for your bytes π·οΈ
π EXAMPLES π
parse test.wat and write to .wasm binary file with the same name
$ wat2wasm test.wat
parse test.wat and write to binary file test.wasm
$ wat2wasm test.wat -o test.wasm
parse spec-test.wast, and write verbose output to stdout (including the meaning of every byte)
$ wat2wasm spec-test.wast -v
π SEE ALSO π
wasm-interp(1), wasm-objdump(1), wasm-stats(1), wasm-strip(1), wasm-validate(1), wasm2c(1), wasm2wat(1), wast2json(1), wat-desugar(1), spectest-interp(1) β the whole friend group fr fr π«Ά
π BUGS π
if you find a bug, please report it at https://github.com/WebAssembly/wabt/issues. don't suffer in silence, bestie, tell the maintainers π
alright that's the whole page! this one's from the Debian crew, version placeholder $Mdocdate$, and the manual is WABT(1) β go forth and compile your little text files into bytes, you absolute icon π
β¨π
π¦ where this page comes from
- arch rolling: wabt 1.0.42-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms