JaggerScript / docsProject documentation

Reference

Evaluation Semantics

Look up syntax, contracts, layouts, algorithms, and exact behavior.

Evaluation is state-transforming. Most executable tokens consume an interpreter state and return an updated state plus, when applicable, a value. Function invocation creates a new frame, binds arguments, evaluates the function body in order, and unwinds on return. Constructors reuse the same mechanism while temporarily switching the running instance.

⟨s,S⟩⇓S′\langle s, S \rangle \Downarrow S'
Statement evaluation. Statements transform interpreter state.
⟨e,S⟩⇓(v,S′)\langle e, S \rangle \Downarrow (v, S')
Expression evaluation. Expressions produce a value and may also update state when calls or allocation occur.
FuncCall
  |
  v
resolve receiver scope
  |
  v
lookup function in class table
  |
  v
push stack frame and bind args
  |
  v
evaluate body until return/break/end
  |
  v
pop frame and restore running instance
Function call path. Function calls isolate locals in a stack frame while preserving object identity through the heap.

Break is represented as a control signal rather than as an ordinary value. Loop evaluation catches the break signal and exits the nearest loop; return exits the current function body with the produced value.