Skip to main content

Crate cljrs_eval

Crate cljrs_eval 

Source
Expand description

IR-accelerated evaluation for clojurust.

Wraps the tree-walking interpreter (cljrs-interp) with IR lowering and interpretation. When a function has been lowered to IR (eagerly at definition time or from a pre-built cache), calls are dispatched to the tier-1 IR interpreter; otherwise they fall back to tree-walking.

Key components:

  • ir_interp — tier-1 IR interpreter (register-file execution of IrFunction)
  • ir_cache — thread-safe cache of lowered IR keyed by arity ID
  • ir_convert — converts Clojure Value data → Rust IrFunction
  • lower — bridges the Clojure compiler front-end to produce IR
  • apply — IR-aware function dispatch with tree-walk fallback

Modules§

apply
Extended apply routines, tries IR evaluation and falls back to tree-walking.
ir_cache
Thread-safe IR cache for compiled function arities.
ir_convert
Convert Clojure Value data (maps/vectors/keywords) → Rust IR types.
ir_interp
Tier 1 IR interpreter: executes IrFunction over a VarId→Value register file.
lower
Clojure-based IR lowering orchestration.

Structs§

Env
The full execution environment: a stack of local frames plus the global env.
GlobalEnv
The global mutable store of all namespaces.

Enums§

EvalError

Functions§

ensure_compiler_loaded
Load the Clojure compiler namespaces and mark the compiler as ready for IR lowering. Called lazily on first lowering attempt.
eval
Evaluate a Form in the given Env.
invoke
load_ns
Find, load, and wire up the source file for spec.ns.
load_prebuilt_ir
Load pre-built IR from a serialized bundle into the IR cache.
register_compiler_sources
standard_env
standard_env_minimal
standard_env_with_paths

Type Aliases§

EvalResult