Skip to main content

Module interpreter

Module interpreter 

Source
Expand description

The rl tree-walking interpreter.

§Pipeline

source text
  └─ Tokenizer::lex()       → Vec<Token>
  └─ Parser::parse()        → Vec<Statement>
  └─ Resolver::resolve()    → Vec<Statement>  (names → depth/slot)
  └─ Evaluator::evaluate_program() → ()

§Modules

  • evaluator - the core [Evaluator] struct and expression evaluation
  • values - the [Value] enum representing all runtime values
  • native - [Module], [NativeFn], and the trait system for binding Rust functions
  • scopes - environment stack: push/pop/insert/assign/get
  • stdlib - all built-in stdlib modules
  • utils - binary/unary operator dispatch and statement evaluation

Modules§

evaluator
Core evaluator - expression evaluation, function calls, and the runtime state.
evaluator_types 🔒
Extra expression evaluation helpers that live outside the main evaluator.rs to keep it from becoming too large.
native
The native function binding system - Module, NativeFn, and the IntoNativeFn / FromValue / IntoValue trait machinery.
scopes 🔒
Environment stack operations - scope management and slot-indexed value access.
stdlib
The rl standard library - all built-in modules registered under std::*.
utils 🔒
Internal evaluator utilities - binary/unary operator dispatch and statement evaluation.
values
Runtime value types for the rl interpreter.