WASM-CTOR-EVAL(1)
π 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β enablememory.copyandmemory.fill--disable-bulk-memory-optβ disablememory.copyandmemory.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 formKEY@VALUE. IfKEYis the name of a pass then it applies to the closest instance of that pass before us. IfKEYis 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 tostderr
π 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
- ubuntu stonking: binaryen 131-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms