WASM-CTOR-EVAL(1)

πŸ“¦
version 131 Β· 3 versions
, in ubuntu stonking

πŸ’… NAME

wasm-ctor-eval β€” bestie, it runs your code at compile time. Yes, literally before anything even runs. The manual is WASM-CTOR-EVAL(1) if you're the type to cite sources. ✨


πŸ¦‹ DESCRIPTION

================================================================================
wasm-ctor-eval INFILE

Execute code at compile time
================================================================================

okay so, the whole vibe: you hand it an INFILE, and it executes the code at compile time. That's the plot. πŸŽ€


πŸ‘‘ wasm-ctor-eval options

these are the ones that actually do the thing you came here for:

  • --output, -o β€” the output file, aka where your little treasure goes 🫢
  • --emit-text, -S β€” emit text instead of binary for the output file (so you can actually read it, periodt)
  • --debuginfo, -g β€” emit the names section and debug info, for when you need to see exactly what's going on πŸ‘€
  • --ctors, -c β€” a comma-separated list of global constructor functions to evaluate, no cap
  • --kept-exports, -ke β€” comma-separated list of ctors whose exports we keep around even if we eval those ctors. Protective bestie behavior πŸ₯Ί
  • --ignore-external-input, -ipi β€” assumes no env vars are to be read, stdin is empty, etc. Full hermit mode πŸ™ˆ
  • --quiet, -q β€” do not emit verbose logging about the eval process. Silence is golden πŸ’…

πŸ› οΈ Tool options

the feature-flag section. it's giving ✨control freak✨ but in a helpful way:

  • --mvp-features, -mvp β€” disable all non-MVP features
  • --all-features, -all β€” enable all features. everything. all of it. πŸ”₯
  • --detect-features β€” (deprecated - this flag does nothing) so like, don't bother πŸ’€
  • --quiet, -q β€” emit less verbose output and hide trivial warnings. yes this one shows up again, it's just That Girl πŸŽ€
  • --experimental-poppy β€” parse wast files as Poppy IR for testing purposes
  • --emit-module-names β€” emit module names, even if not emitting the rest of the names section
  • --enable-sign-ext β€” enable sign extension operations
  • --disable-sign-ext β€” disable sign extension operations
  • --enable-threads β€” enable atomic operations
  • --disable-threads β€” disable atomic operations
  • --enable-mutable-globals β€” enable mutable globals
  • --disable-mutable-globals β€” disable mutable globals
  • --enable-nontrapping-float-to-int β€” enable nontrapping float-to-int operations
  • --disable-nontrapping-float-to-int β€” disable nontrapping float-to-int operations
  • --enable-simd β€” enable SIMD operations and types
  • --disable-simd β€” disable SIMD operations and types
  • --enable-bulk-memory β€” enable bulk memory operations
  • --disable-bulk-memory β€” disable bulk memory operations
  • --enable-bulk-memory-opt β€” enable memory.copy and memory.fill
  • --disable-bulk-memory-opt β€” disable memory.copy and memory.fill
  • --enable-call-indirect-overlong β€” enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
  • --disable-call-indirect-overlong β€” disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
  • --enable-exception-handling β€” enable exception handling operations
  • --disable-exception-handling β€” disable exception handling operations
  • --enable-tail-call β€” enable tail call operations
  • --disable-tail-call β€” disable tail call operations
  • --enable-reference-types β€” enable reference types
  • --disable-reference-types β€” disable reference types
  • --enable-multivalue β€” enable multivalue functions
  • --disable-multivalue β€” disable multivalue functions
  • --enable-gc β€” enable garbage collection
  • --disable-gc β€” disable garbage collection
  • --enable-memory64 β€” enable memory64
  • --disable-memory64 β€” disable memory64
  • --enable-relaxed-simd β€” enable relaxed SIMD
  • --disable-relaxed-simd β€” disable relaxed SIMD
  • --enable-extended-const β€” enable extended const expressions
  • --disable-extended-const β€” disable extended const expressions
  • --enable-strings β€” enable strings
  • --disable-strings β€” disable strings
  • --enable-multimemory β€” enable multimemory
  • --disable-multimemory β€” disable multimemory
  • --enable-stack-switching β€” enable stack switching
  • --disable-stack-switching β€” disable stack switching
  • --enable-shared-everything β€” enable shared-everything threads
  • --disable-shared-everything β€” disable shared-everything threads
  • --enable-fp16 β€” enable float 16 operations
  • --disable-fp16 β€” disable float 16 operations
  • --enable-custom-descriptors β€” enable custom descriptors (RTTs) and exact references
  • --disable-custom-descriptors β€” disable custom descriptors (RTTs) and exact references
  • --enable-multibyte β€” enable multibyte array loads and stores
  • --disable-multibyte β€” disable multibyte array loads and stores
  • --enable-relaxed-atomics β€” enable acquire/release atomic memory operations
  • --disable-relaxed-atomics β€” disable acquire/release atomic memory operations
  • --enable-custom-page-sizes β€” enable custom page sizes
  • --disable-custom-page-sizes β€” disable custom page sizes
  • --enable-wide-arithmetic β€” enable wide arithmetic
  • --disable-wide-arithmetic β€” disable wide arithmetic
  • --enable-compact-imports β€” enable compact import section
  • --disable-compact-imports β€” disable compact import section
  • --enable-typed-function-references β€” Deprecated compatibility flag
  • --disable-typed-function-references β€” Deprecated compatibility flag
  • --no-validation, -n β€” disables validation, assumes inputs are correct 🫣 (it's trusting you. fully. be normal about it)
  • --pass-arg, -pa β€” an argument passed along to optimization passes being run. Must be in the form KEY@VALUE. If KEY is the name of a pass then it applies to the closest instance of that pass before us. If KEY is not the name of a pass then it is a global option that applies to all pass instances that read it.
  • --closed-world, -cw β€” assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. The outside may hold on to them and pass them back in, but not inspect their contents or call them.
  • --preserve-type-order β€” preserve the order of types from the input (useful for debugging and testing)
  • --generate-stack-ir β€” generate StackIR during writing
  • --optimize-stack-ir β€” optimize StackIR during writing
  • --print-stack-ir β€” print StackIR during writing

🌈 General options

the "hi, how are you" options. the little guys. πŸ“

  • --version β€” output version information and exit
  • --help, -h β€” show this help message and exit
  • --debug, -d β€” print debug information to stderr

πŸ’– heads up bestie: a whole bunch of these flags literally say "Deprecated compatibility flag" or "deprecated - this flag does nothing" in the actual source, so don't come for me, I'm just the messenger ✨

and that's the whole page!! mwah πŸ’‹ you ate. this was wasm-ctor-eval version 131, page dated August 2026 β€” go forth and evaluate your constructors at compile time, icon πŸŽ€πŸ’…πŸ‘‘

πŸ“¦ where this page comes from