whamm-dsl — The `.mm` Monitor Language
A .mm script is the instrumentation program whamm! injects into a WebAssembly binary (or compiles for engine-support). Each script contains global declarations followed by one or more probes. whamm! statically analyses match rules to decide which probes apply at each site, folding away constant guards before injection.
For installing whamm! and running instrumented modules, load the companion whamm skill in this plugin.
Script structure
A .mm file contains, in order:
usedeclarations —use lib;imports a named library.- Global variable declarations —
report var,var, etc. declared at file scope. - Function definitions —
name(args) -> ret { .. }(NOT YET IMPLEMENTED). - Probes — one or more match-rule blocks, each optionally gated by a predicate.
Match rules
provider:package:event:mode / predicate / { actions }
The predicate is optional. Without it: provider:package:event:mode { actions }.
Hierarchy: wasm (provider) → package → event → mode.
| Package | Events | Modes |
|---------|--------|-------|
| opcode | any opcode name or glob | before, after, alt |
| func | _(any function)_ | entry, exit (unwind planned) |
| block | end | _(none)_ |
| _(none)_ | begin, end, report | _(none — top-level probes)_ |
Globbing examples:
wasm:opcode:*:before # all opcodes, before
wasm::*if:before # if + br_if (empty package = wildcard)
wasm:opcode:*load*|*store*:before # all memory loads and stores
wasm:opcode:call|return_call:before
Type bounds narrow polymorphic args: wasm:opcode:call(arg0: i32):before matches only call sites where arg0 is i32.