Skip to main content

cljrs_runtime/
lib.rs

1//! The clojurust runtime: environment, builtins, tree walker, and tiered evaluation.
2//!
3//! This package is the merge of four formerly separate packages. Each is now a
4//! module:
5//!
6//! | Module | Former package | Responsibility |
7//! |---|---|---|
8//! | [`env`] | `cljrs-env` | Namespaces, vars, dynamic bindings, GC roots, loader |
9//! | [`builtins`] | `cljrs-builtins` | Native `clojure.core` functions and bootstrap source |
10//! | [`interp`] | `cljrs-interp` | Tree-walking interpreter, special forms, macros |
11//! | [`tiered`] | `cljrs-eval` | IR lowering, tier-1 IR interpreter, JIT dispatch state |
12//!
13//! The four former packages remain as thin re-export shims for one migration
14//! stage; new code should depend on `cljrs-runtime` and use these module paths.
15//!
16//! Construction goes through one path — [`Runtime::builder`] — and the
17//! execution mode it selects ([`ExecutionMode`]) is what decides whether a
18//! call tree-walks, runs lowered IR, or jumps to JIT-compiled native code.
19
20// EvalError::Thrown wraps a full Value; boxing would require pervasive changes.
21#![allow(clippy::result_large_err)]
22// Namespace/GlobalEnv use Mutex<HashMap<Arc<str>, GcPtr<Var>>> — intentionally verbose for clarity.
23#![allow(clippy::type_complexity)]
24#![allow(clippy::arc_with_non_send_sync)]
25
26pub mod builtins;
27pub mod env;
28pub mod interp;
29pub mod mode;
30pub mod runtime;
31pub mod tiered;
32
33pub use mode::{ExecutionMode, TierState};
34pub use runtime::{BuildError, Runtime, RuntimeBuilder};