Skip to main content

Crate sui_eval

Crate sui_eval 

Source
Expand description

Clean-room Nix language evaluator.

Architecture: Nix source → rnix parser (CST) → Evaluator (values)

Parsing is delegated to the rnix crate (MIT).

Re-exports§

pub use eval::eval;
pub use eval::eval_with_file;
pub use value::EvalError;
pub use value::Value;

Modules§

builtins
Core Nix builtins (90+ functions). Core Nix builtins.
convert
Bidirectional conversion between bytecode VM values and tree-walker values. Bidirectional conversion between bytecode VM values and tree-walker values.
drv_cache
Content-addressed derivation path cache (redb-backed). Content-addressed derivation path cache.
eval
Tree-walking evaluator using rnix’s typed AST. Tree-walking Nix evaluator using rnix’s typed AST.
eval_cache
Content-addressed evaluation cache (file hash + lock hash → result). Content-addressed evaluation cache.
fetcher
Content-addressed input fetcher for flake.lock resolved inputs. Content-addressed input fetcher for flake.lock resolved inputs.
flake
Re-export flake lock types from sui-compat where they canonically live.
flake_lock
Native flake lock management — update, check, write. Native flake lock management — update, check, and write flake.lock.
git
Pure-Rust git operations via gix/gitoxide (no CLI spawning, no C deps). Pure-Rust git helpers using gix (gitoxide).
lazy
Lazy evaluation primitives — making accidental eagerness impossible. Lazy evaluation primitives — making accidental eagerness impossible.
path
Centralized path resolution (normalize, resolve relative, import). Centralized path resolution for the Nix evaluator.
perf
Lightweight evaluation profiling counters. Lightweight evaluation profiling counters. Enabled via SUI_EVAL_PERF=1 environment variable.
pos
Source positions for builtins.unsafeGetAttrPos / __curPos. Source positions for builtins.unsafeGetAttrPos (and __curPos).
realize
Import-from-derivation: realize a derivation output mid-eval via a binary-installed hook (the pure evaluator owns no build pipeline). Import-from-derivation (IFD): realize a derivation’s output mid-eval.
render
The normalized differential render (deep-forcing, error-propagating) the sui↔sui differential + the SUI_IR shadow-eval latch byte-compare against eval_ir. Must stay format-locked with sui_ir::render. The tree-walker’s normalized differential render.
resolve_env
ENV-RESOLVE M0 flag + per-source resolution-table plumbing (the tree-walker’s consume side of the sui-resolve side-table). ENV-RESOLVE M0 — the tree-walker’s consume side of the sui-resolve parse-time variable-resolution side-table.
trace
Infinite recursion debugging tools (force chain, trace, depth limit, stats). Infinite recursion debugging tools for the tree-walker evaluator.
value
Nix value types, environments, thunks, and error types. Nix value types and environments.

Structs§

BytecodeEvaluator
Bytecode VM evaluator — compiles to bytecode and executes on the stack VM.
TreeWalkEvaluator
The default tree-walking evaluator.

Traits§

Evaluator
The evaluator trait — enables swapping evaluation strategies.

Functions§

eval_to_string_keyed
Convert a tree-walker Value to a StringKeyedValue (no interner needed).