Skip to main content

Module interpreter

Module interpreter 

Source
Expand description

The interpreter: walk the ast and run it.

This is a tree-walking interpreter. It keeps a stack of scopes (one per block) holding the live bindings, plus a table of function definitions. lux is statically typed by design, but has no separate type checker yet — instead the interpreter enforces lux’s no-coercion rule at the moment of each operation, so "5" + 3 fails with a clear error rather than silently guessing. A real checker that catches these before the program runs is a later milestone.

Enums§

Value

Functions§

run
Run a parsed program. program_args is the program’s command line — the script (or binary) at index 0, then anything the user passed after it.