Skip to main content

tatara_eval/
lib.rs

1//! tatara-eval — an optimized in-memory Lisp interpreter.
2//!
3//! Takes `Sexp` from `tatara-lisp`, evaluates to `Value`. Produces typed
4//! `Derivation` values via the `derivation` builtin, which `tatara-nix::realize`
5//! then builds into concrete store paths (either our own store or the live
6//! `/nix/store` on disk).
7//!
8//! ```text
9//! source  ──read──►  Sexp  ──eval──►  Value
10//!                                      │
11//!                                      ▼ (if Derivation)
12//!                            tatara-nix::realize
13//!                                      │
14//!                                      ▼
15//!                                 StorePath
16//! ```
17//!
18//! The interpreter is Rust-bordered (you get a typed `Derivation` or a typed
19//! error, never a partially-built thing), Lisp-authorable, and cheap to
20//! clone thanks to `Arc`-backed `Value` cells. A future `&'arena` form can
21//! replace the `Arc`s without changing the public API.
22
23pub mod builtins;
24pub mod env;
25pub mod error;
26pub mod interpreter;
27pub mod system;
28pub mod value;
29
30pub use env::Env;
31pub use error::{EvalError, Result};
32pub use interpreter::Interpreter;
33pub use system::system_builtin_table;
34pub use value::{Arity, Builtin, Lambda, Thunk, ThunkState, Value};