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 no longer exist — Stage 6 of the crate
14//! consolidation deleted their re-export shims. These module paths are the
15//! only paths.
16//!
17//! Construction goes through one path — [`Runtime::builder`] — and the
18//! execution mode it selects ([`ExecutionMode`]) is what decides whether a
19//! call tree-walks, runs lowered IR, or jumps to JIT-compiled native code.
20
21// EvalError::Thrown wraps a full Value; boxing would require pervasive changes.
22#![allow(clippy::result_large_err)]
23// Namespace/GlobalEnv use Mutex<HashMap<Arc<str>, GcPtr<Var>>> — intentionally verbose for clarity.
24#![allow(clippy::type_complexity)]
25#![allow(clippy::arc_with_non_send_sync)]
26
27pub mod builtins;
28pub mod env;
29pub mod interp;
30/// Diagnostic logging configuration (native only; see the module docs).
31#[cfg(not(target_arch = "wasm32"))]
32pub mod logging;
33pub mod mode;
34pub mod runtime;
35pub mod tiered;
36
37pub use mode::{ExecutionMode, TierState};
38pub use runtime::{BuildError, Runtime, RuntimeBuilder};