Skip to main content

sim_lib_expr_tree/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Loadable expression-tree runtime and Lisp surface.
4//!
5//! [`ExprTreeLib`] installs the stable `expr-tree/*` operation family, one
6//! argument and result [`sim_kernel::Shape`] contract for every operation, and
7//! browseable [`sim_kernel::card::Card`] projections. Calls retain ordinary
8//! SIM expressions and values while composing the finite namespace,
9//! mixed-backend store, bounded incremental calculator, inherited codec
10//! policy, standard progress streams, and Citizen reconstruction records.
11//!
12//! Live [`TreeHandle`] values remain opaque runtime authority: only
13//! [`DurableSourceRecord`] and [`DurablePolicyRecord`] participate in
14//! Citizen/read-construct.
15
16mod capability;
17mod citizen;
18mod dispatch;
19mod handle;
20mod inspect;
21mod operation;
22mod parse;
23mod projection;
24mod runtime;
25mod runtime_support;
26mod shape;
27mod source;
28
29pub use capability::{
30    expr_tree_calculate_capability, expr_tree_mount_capability, expr_tree_read_capability,
31    expr_tree_write_capability,
32};
33pub use citizen::{
34    DurablePolicyRecord, DurableSourceRecord, durable_policy_class_symbol,
35    durable_source_class_symbol, expr_tree_citizen_registry,
36};
37pub use handle::TreeHandle;
38pub use inspect::{TreeCellInspection, TreeEntryInspection, TreeEntryKind};
39pub use operation::{
40    ExprTreeLib, expr_tree_exports, expr_tree_lib_symbol, expr_tree_operation_cards_symbol,
41    expr_tree_operation_symbols, install_expr_tree_lib,
42};
43pub use projection::operation_cards;
44pub use runtime::{MAX_LIST_ITEMS, MAX_TREE_NODES};
45pub use shape::{operation_args_shape_symbol, operation_result_shape_symbol};
46
47/// Cookbook recipes embedded with the loadable library.
48pub static RECIPES: sim_cookbook::EmbeddedDir =
49    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
50
51/// Returns the crate's public runtime-library identity.
52pub fn crate_identity() -> &'static str {
53    "sim-lib-expr-tree"
54}
55
56/// Returns the lower-layer identities composed by this library.
57pub fn component_identities() -> [&'static str; 2] {
58    [
59        sim_expr_tree_core::crate_identity(),
60        sim_expr_tree_calc::crate_identity(),
61    ]
62}
63
64#[cfg(test)]
65mod tests;