rune-interp 0.1.0

rune interpreter — tree-walking Nox evaluator; instant start by construction
Documentation
  • Coverage
  • 65.38%
    17 out of 26 items documented0 out of 15 items with examples
  • Size
  • Source code size: 51.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 719.57 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mastercyb

Tree-walking Nox interpreter — the instant-start execution path. Implements all 18 Nox reduction patterns directly over Noun trees. No external dependencies; no build phase; executes the moment parsing is done.

Nox reduction rules (patterns 0–17):

Structural (5): [0 n] axis: n=0 hash-introspect, n=1 identity, n=2 head, n=3 tail, n=2k → head(axis(k)), n=2k+1 → tail(axis(k)) [1 v] quote: return v unchanged [2 a b] compose: eval both a,b against subject; reduce(result_a, result_b) [3 a b] cons: Noun::cell(eval(a), eval(b)) [4 test y n] branch: eval test; if result==0 → eval y else → eval n

Field arithmetic over F_p where p = GOLDILOCKS_PRIME (6): [5 a b] add: (eval_a + eval_b) % p [6 a b] sub: (eval_a - eval_b + p) % p [7 a b] mul: (eval_a * eval_b) % p [8 a] inv: modular inverse of eval_a under p (0 maps to 0) [9 a b] eq: 0 if equal, 1 if not (atoms and cells, structural) [10 a b] lt: 0 if eval_a < eval_b, 1 otherwise

Bitwise over u64 (4): [11 a b] xor: eval_a XOR eval_b [12 a b] and: eval_a AND eval_b [13 a] not: bitwise NOT of eval_a [14 a n] shl: eval_a << eval_n

Hash + async stubs (3): [15 a] hash: stub — return eval_a (real hemera hash in M2) [16 [tag sel] body] hint/call: evaluate body; tag/selector are reactive metadata (M5) [17 path] look: stub for graph scry — return Atom(0) (M2)

Distribution rule: when formula is [f1 f2] where f1 is itself a cell (not an atom opcode prefix), eval both sides against subject and return [result_f1, result_f2]. This is the "auto-cons" / distribute pattern.