Skip to content

Run a program

Check a source file before running it:

target/release/gremlin check examples/affine.gremlin

Then execute it with fixed-width hexadecimal arguments:

target/release/gremlin run examples/affine.gremlin --args 0x0000000000000005 --max-steps 256

The result is JSON:

{"status":"completed","steps":7,"type":"u64","value":"0x000000007f6e5d6e"}

Arguments are comma-separated, fixed-width hexadecimal values. A u8 argument uses two hex digits; a u64 uses sixteen. Signed arguments use their two’s-complement bit pattern.

Functions accept zero to four integer arguments and return one integer. Strings, pointers, arrays, and floating-point values are not direct inputs.

Gremlin source is its own language, not Rust. It supports integer operations, mutable locals, branches, loops, and bounded module calls. See the language reference, control-flow example, and recursion example.

run defaults to 256 execution steps and a call-depth limit of 64. Use --max-steps and --max-call-depth to change those limits. The execution model explains how Gremlin accounts for steps and call depth.