The Language
whamm!
enables tool implementers to express their instrumentation in terms of program events and corresponding predicated actions;
"When this event occurs during program execution, do these actions if this predicate (or conditional) evaluates to true
."
This abstraction provides a high-level and intuitive syntax that can target events at various granularities in the instrumented program.
Read on for an overview of the syntax and semantics of the language.
Language Concepts
- Variables are used to store data.
- Logical operations can be used to combine boolean expressions.
- Ternary Expressions can be used for succinct conditional variable assignments.
- Primitive types are numbers, booleans, and strings.
- Various arithmetic operations can be used with numbers.
- Strings are key for dealing with files, text, etc.
- Tuples allow using multiple values where one value is expected.
- Maps are key for storing large amounts of data, but they're implemented quite differently in
whamm!
. - Function definitions can be used to reuse code snippets.
- Conditionals are if/else/elif statements used for simple control flow
- And finally, probes are used to express instrumentation.
- All of this syntax is used to write
whamm!
scripts.