WABT(1)

πŸ’… WABT(1) β€” wasm-stats, bestie edition πŸŽ€

okay so real quick, this whole page lives in the General Commands Manual for WABT, and today's main character is wasm-stats. she's the one we're talking about. let's go ✨


🌸 NAME 🌸

wasm-stats β€” show stats for a module. that's it, that's the job. she counts things so you don't have to 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

wasm-stats [options] filename+

notice the filename+?? that plus is doing SO much work. you can hand her more than one file, bestie. she'll take them all, no cap πŸ’–


✨ DESCRIPTION ✨

wasm-stats reads a file in the wasm binary format and outputs stats. like, she looks at your module and goes "here's the tea, here's the numbers" πŸ“ŠπŸ”₯

The options are as follows:

  • --help β€” print this help message. the classic. the icon.
  • --version β€” print version information. identity check πŸͺž
  • -v, --verbose β€” use multiple times for more info. yes, you can stack her. more -v = more yapping, and honestly we love that for us πŸ’¬
  • --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)
  • --disable-annotations β€” disable custom annotation syntax
  • --enable-code-metadata β€” enable code metadata
  • --enable-gc β€” enable garbage collection πŸ—‘οΈβœ¨
  • --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 "just give me everything" option, the girl dinner of flags πŸ½οΈπŸ‘‘
  • -o, --output=FILENAME β€” output file for the stats, by default use stdout
  • -c, --cutoff=N β€” cutoff for reporting counts less than N. i.e. if a count is below N, she's not reporting it. keep it cute, keep it filtered πŸ’…
tiny note bestie: the disable ones start enabled-ish and the enable ones start off β€” that's literally what "enable"/"disable" means here, i'm not out here inventing lore πŸ™ˆ

🌈 EXAMPLES 🌈

parse binary file test.wasm and write opcode dist file test.dist:

$ wasm-stats test.wasm -o test.dist

see how easy that was?? one line, one dist file, main character energy fr fr πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

the whole friend group, in order: wasm-interp(1), wasm-objdump(1), wasm-strip(1), wasm-validate(1), wasm2c(1), wasm2wat(1), wast2json(1), wat-desugar(1), wat2wasm(1), spectest-interp(1) 🌸🫢


πŸ’€ BUGS πŸ’€

if you find a bug, please report it at https://github.com/WebAssembly/wabt/issues. don't suffer in silence, that's not the vibe β€” tell the maintainers, they'll handle it πŸ›βž‘οΈπŸ”§


and that's the page, bestie!! brought to you by the Debian packagers, dated $Mdocdate$, and filed under WABT(1) β€” go forth and stat your wasms πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from