Expand description
tatara-lisp-eval — runtime evaluator for the tatara-lisp authoring surface.
See docs/eval-design.md in the tatara-lisp repo for scope, FFI surface,
error model, and the boundary with the plain tatara-lisp compile pipeline.
This crate extends tatara-lisp; it does not replace it. The plain Sexp
AST and compile_typed flow remain the fast, committed, cacheable path
for typed infrastructure DSLs. tatara-lisp-eval is for the runtime /
REPL / ad-hoc path — live orchestration, rule evaluation, hot-reloaded
diagnostic bundles.
§Phase progress (Phase 2.2 scaffold)
This commit establishes shape: module layout, public types, stub interpreter that evaluates only literal atoms. Subsequent phases (2.3-2.7) fill in special forms, FFI, REPL, errors, tests.
Re-exports§
pub use env::Env;pub use error::EvalError;pub use error::Result;pub use eval::Interpreter;pub use ffi::Arity;pub use ffi::Caller;pub use ffi::FromValue;pub use ffi::HigherOrderCallable;pub use ffi::IntoValue;pub use ffi::NativeCallable;pub use hof::install_hof;pub use lisp_stdlib::install_lisp_stdlib_with;pub use map::install_map;pub use module::FilesystemLoader;pub use module::Loader;pub use module::MapLoader;pub use module::Module;pub use module::ModuleError;pub use module::ModuleRegistry;pub use module::NoLoader;pub use primitive::install_primitives;pub use repl::ReplSession;pub use value::ErrorObj;pub use value::MapKey;pub use value::Value;
Modules§
- build_
check - Build-time gradual type checking — the static counterpart to
type_check.rs. Walks a parsedSpannedprogram; for every form that bears a type annotation ((the type expr),(defn-typed name (...) -> type body...),(declare name type)), checks that the inferred type of the underlying expression conforms. - channel
- Channels — bounded mpsc-style FIFOs as first-class Values.
- code
- Bidirectional
Spanned↔Valueconversion. - env
- Lexical environment holding
Values. - error
- Runtime evaluator errors.
- eval
- Core evaluator.
- ffi
- FFI — register Rust functions as callable Lisp procedures.
- fiber
- Fibers — first-class suspended computations.
- hof
- Higher-order primitives — functions that invoke a callable
Valueback into the eval loop. - interner
- Thread-local symbol interner.
- lisp_
stdlib - Pure-Lisp standard library — installed after the Rust primitives and
the higher-order Rust primitives (hof.rs) are registered. Defined as
tatara-lisp source embedded with
include_str!. - map
- Hash-map primitives —
Value::Mapoperations. - module
- Module system — file-as-module + qualified names + alias imports.
- primitive
- Built-in primitive procedures.
- repl
- Streaming / REPL-style evaluation.
- special
- Special-form dispatch.
- type_
check - Runtime type-checking primitives.
- value
- Runtime values.
- vm
- Bytecode VM — stack-based, side-by-side with the tree-walker.
Structs§
- Span
- A half-open byte range
[start, end)into the source. - Spanned
- An S-expression node with source position.
- Spanned
Expander - Span-preserving macro expander.
Enums§
- Sexp
- An S-expression — the homoiconic value + program representation.
- Spanned
Form - Same variants as
Sexp, but children areSpannedso every subtree carries its own position.
Functions§
- install_
full_ stdlib_ with - One-stop installer: registers the full battery — Rust primitives (arithmetic, comparison, list, string, IO), higher-order Rust primitives (apply, map, filter, foldl, foldr, reduce, find, …), and the pure-Lisp standard library (compose, pipe, ->, ->>, defflow, dotimes, range, distinct, group-by helpers, etc.).
- read
- Read a full program (sequence of top-level forms) into a
Vec<Sexp>. - read_
spanned - Read a full program into
Vec<Spanned>, where every subtree carries aSpanpointing back intosrc. Equivalent toreadin grammar and error reporting; strictly additive.