Skip to main content

Crate tatara_lisp_eval

Crate tatara_lisp_eval 

Source
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 parsed Spanned program; 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 SpannedValue conversion.
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 Value back 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::Map operations.
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.
SpannedExpander
Span-preserving macro expander.

Enums§

Sexp
An S-expression — the homoiconic value + program representation.
SpannedForm
Same variants as Sexp, but children are Spanned so 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 a Span pointing back into src. Equivalent to read in grammar and error reporting; strictly additive.