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 literal externref stays 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