Wax offers a Rust-like syntax for WebAssembly, complete with tools to type-check, reformat, and convert code between Wax, Wasm binary, and Wasm text formats.
Requirements: Opam (2.1+) and OCaml 5.0+.
# Install dependencies
opam install . --deps-only
# Build
dune build
# Run tests
dune runtest
# Install
opam install .- Formatting: Ensures consistent code style.
- Type Checking: Verifies the semantic correctness of Wax code.
- Syntax Conversion: Supports conversion between Wax, WebAssembly Text (WAT), and eventually WebAssembly Binary.
Full documentation is available at vouillon.github.io/wax/.
You can also build the documentation locally using mdbook build docs.
Usage: `wax [OPTION]… [INPUT]
[INPUT]: Source file to convert/format. Optional. If omitted, the tool reads fromstdin.
-f,--format,--output-format: Output format (Default: Auto/wasm). Values:wat,wasm,wax.-i,--input-format: Input format (Default: Auto/wax). Values:wat,wasm,wax.-o,--output: Output file (Default:stdout).-v,--validate: Perform validation (type checking for Wax, well-formedness for Wasm Text). Validation is disabled by default.-s,--strict-validate: Perform strict reference validation (for Wasm Text). This overrides the default relaxed reference validation behavior.--color: Color output:always,never, orauto(default).autocolors only if output is a TTY.--fold: Fold instructions into nested S-expressions (for Wasm Text output).--unfold: Unfold instructions into flat instruction lists (for Wasm Text output).
