WABT(1)
π WABT(1) β the wast2json era π
okay so bestie, welcome to the WABT girlies' corner of the manual. this one's all about wast2json, and yes she's iconic, yes she eats, let's get into it π
β¨ NAME β¨
wast2json β convert a file in the wasm spec test format to a JSON file and associated wasm binary files
like literally she takes your .wast and gives you back a JSON plus a lil pile of .wasm binaries. no cap. π¦
πΈ SYNOPSIS πΈ
wast2json [options] filename
one filename, and then whatever options your heart desires. that's the whole vibe check. π
π DESCRIPTION π
so wast2json reads a file in the wasm spec test format, checks it for errors (yes she's a good friend like that, she'll tell you if something's wrong π), and converts it to a JSON file and associated wasm binary files.
the options are as follows, and there are A LOT of them, so buckle up buttercup:
--helpβ prints this help message. the classic. the blueprint. π«Ά--versionβ print version information. who are you, really?-v,--verboseβ use multiple times for more info. stack her up, she gets chattier every time, iykyk π₯--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 ποΈβ¨ (not the vibes kind, the memory kind)--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, give me the whole menu" option π-o,--output=FILEβ output JSON file-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--debug-namesβ Write debug names to the generated binary file
lowkey noticing how many of these are--disablevs--enable? yeah. she's got opinions about defaults and she's not sorry. π
π EXAMPLES π
ok so hear me out β parse spec-test.wast, and write files to spec-test.json. Modules are written to spec-test.0.wasm, spec-test.1.wasm, etc. (yes babe, numbered. one for every module. it's giving organized.)
$ wast2json spec-test.wast -o spec-test.json
literally that's it. she ate and left no crumbs. π
π SEE ALSO π
the whole friend group, fr fr:
wasm-interp(1), wasm-objdump(1), wasm-stats(1), wasm-strip(1), wasm-validate(1), wasm2c(1), wasm2wat(1), wat-desugar(1), wat2wasm(1), spectest-interp(1)
group chat's poppin' off, ngl. π§
π BUGS π
If you find a bug, please report it at https://github.com/WebAssembly/wabt/issues.
don't be shy, bestie β they literally want to know. it's not snitching, it's contributing to open source. main character energy. β
and that's the tea π« β this page came to you from the Debian fam, with the $Mdocdate$ date stamped on it, and it's all wrapped up as WABT(1). go forth and convert some spec tests, queen ππ
π¦ 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