wasmedge-compile(1)

πŸ“¦
version 0.16.1 Β· 5 versions
, in ubuntu stonking

✨ wasmedge-compile ✨

okay so bestie, welcome to the wasmedge-compile manual page β€” that's the one from the General Commands Manual section, and yes she's a whole icon πŸ’…


🌸 NAME 🌸

wasmedge-compile β€” the AOT compiler for WasmEdge. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

wasmedge compile [OPTIONS] [--] WASM_OR_SO [ARG ...]

πŸ’– DESCRIPTION πŸ’–

okay so the wasmedge compile subcommand takes your WebAssembly and compiles it into native machine code β€” which is just a fancy way of saying it's an Ahead-of-Time (AOT) compiler. she's giving compiler. she's giving ahead of time. periods.

so like, for pure WebAssembly, the wasmedge(1) program (or the equally slay wasmedge run subcommand) will just execute your WebAssembly code in interpreter mode. which is fine! it works! but then β€” after you compile it with the wasmedge compile AOT compiler β€” the wasmedge subcommand can execute that WASM in AOT mode instead, with substantial performance improvements. literally the glow-up arc. πŸ”₯

and ngl, wasmedge compile was previously known as wasmedgec. so if you see that name floating around, it's the same girl, she just rebranded. πŸ’…


✨ OPTIONS ✨

πŸ‘‘ Generic program information

  • -h, --help β€” shows the help messages. and by the way, she will ignore every other argument below. so don't bother stacking them, bestie, she's not listening.
  • -v, --version β€” shows the version information. same energy: she will ignore all the other arguments below. iconic behavior honestly.

πŸŽ€ Basic options

  • --dump β€” dumps the LLVM IR to wasm.ll and wasm-opt.ll. two files. very demure.
  • --interruptible β€” generates a binary that supports interruptible execution.
  • --generic-binary β€” generates a generic binary of the current host CPU architecture.
  • --optimize β€” use --optimize LEVEL to set the optimization level. the LEVEL should be one of 0, 1, 2, 3, s, or z. the default value will be 2, which means O2. (so if you don't say anything, she assumes O2. she's confident like that.)

πŸ“ Statistics information

  • --enable-time-measuring β€” enables generating code for counting time during execution. ⏱️
  • --enable-gas-measuring β€” enables generating code for counting gas burned during execution.
  • --enable-instruction-count β€” enables generating code for counting WebAssembly instructions executed.
  • --enable-all-statistics β€” enables generating code for all the statistics options, including instruction counting, gas measuring, and execution time. the full set. the whole menu. periodt.

🌈 WebAssembly proposals

  • --disable-import-export-mut-globals β€” disables the Import/Export of mutable globals proposal.
  • --disable-non-trap-float-to-int β€” disables the Non-trapping float-to-int conversions proposal.
  • --disable-sign-extension-operators β€” disables the Sign-extension operators proposal.
  • --disable-multi-value β€” disables the Multi-value proposal.
  • --disable-bulk-memory β€” disables the Bulk memory operations proposal.
  • --disable-reference-types β€” disables the Reference types proposal.
  • --disable-simd β€” disables the SIMD proposal.
  • --enable-multi-memory β€” enables the Multiple memories proposal.
  • --enable-tail-call β€” enables the Tail-call proposal.
  • --enable-extended-const β€” enables the Extended-const proposal.
  • --enable-threads β€” enables the Threads proposal.
  • --enable-all β€” enables all features. every single one. all of them. πŸ’€

🧚 EXAMPLE 🧚

so imagine you've got a WebAssembly program sitting under the file fibonacci.wasm, set up so it exports a fib() function and accepts a single i32 integer as the input parameter. bestie, you can literally just run this:

$ wasmedge compile fibonacci.wasm fibonacci_aot.wasm
$ time wasmedge --reactor fibonacci_aot.wasm fib 30

and the execution should be much faster compared to interpreter mode, like:

time wasmedge --reactor fibonacci.wasm fib 30

see the difference? that's the AOT glow-up in action. obsessed. 😭


πŸ’œ AUTHOR πŸ’œ

Copyright Β© 2019-2022 Second State INC. Licensed under the Apache License, Version 2.0.


🫢 SEE ALSO 🫢

πŸ“– Regular manual pages

πŸ“š Full documentation

A complete manual of WasmEdge can be found online.


and that's the whole page, bestie β€” 2026-09-08, the wasmedge-compile(1) era. go compile something gorgeous. slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from