WABT(1)

πŸ’… WABT(1) πŸ’…

okay bestie, welcome to the General Commands Manual page for WABT(1) β€” the main character here is wasm-interp, and she is ready to decode and run your WebAssembly binary file. no cap. πŸ¦‹


🌸 NAME 🌸

wasm-interp β€” decode and run a WebAssembly binary file

✨ SYNOPSIS ✨

wasm-interp [options] filename [arg]...

πŸŽ€ DESCRIPTION πŸŽ€

So like, wasm-interp reads a file in the wasm binary format, and then it runs a stack-based interpreter in it. literally the whole vibe. πŸ’–

The options are as follows, and yes bestie, every single one is included β€” no skips, fr fr:

  • --help β€” print this help message
  • --version β€” print version information
  • -v, --verbose β€” use multiple times for more info
  • --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
  • -V, --value-stack-size=SIZE β€” size in elements of the value stack
  • -C, --call-stack-size=SIZE β€” size in elements of the call stack
  • -t, --trace β€” trace execution
  • -r, --run-export=FUNCTION β€” run an exported function by name
  • -a, --argument=ARGUMENT β€” add an argument to an exported function execution
  • --wasi β€” assume the input module is WASI compliant (export the WASI API from the module and invoke the _start function)
  • -e, --env=ENV β€” pass the given environment string in the WASI runtime
  • -d, --dir=DIR β€” pass the given directory to the WASI runtime
  • --run-all-exports β€” run all the exported functions, in order. useful for testing
  • --host-print β€” include an importable function named "host.print" for printing to stdout

πŸ”₯ EXAMPLES πŸ”₯

parse binary file test.wasm, and type-check it:

$ wasm-interp test.wasm

parse test.wasm and run all its exported functions:

$ wasm-interp test.wasm --run-all-exports

parse test.wasm, run the exported functions and trace the output:

$ wasm-interp test.wasm --run-all-exports --trace

parse test.wasm and run all its exported functions, setting the value stack size to 100 elements:

$ wasm-interp test.wasm -V 100 --run-all-exports

parse test.wasm, run specific exported function by name with argument:

$ wasm-interp test.wasm -r func_sum -a i32:8 -a i32:5

πŸ¦‹ SEE ALSO πŸ¦‹

go be nosy with wasm-objdump(1), wasm-stats(1), wasm-strip(1), wasm-validate(1), wasm2c(1), wasm2wat(1), wast2json(1), wat-desugar(1), wat2wasm(1), and spectest-interp(1). the whole friend group is here. πŸ’œ

πŸ› BUGS πŸ›

If you find a bug, please report it at https://github.com/WebAssembly/wabt/issues.


this little masterpiece is from Debian, dated $Mdocdate$, and it’s the WABT(1) page β€” mwah, bye bestie πŸ’‹βœ¨

πŸ“¦ where this page comes from