Expand description
Public, backend-agnostic surface for Relon evaluation.
This crate is the seam between hosts and evaluator backends; it only re-exports the types a caller actually sees:
- Data shapes:
Value,Scope,Thunk,RuntimeError. - Host configuration surface:
Context,Capabilities,NativeFnGate, native-fn / decorator registration. - Policy boundary: the
CapabilityGatetrait — single source of capability-policy truth consulted by every backend (seecapabilitymodule docs for the enforcement-timing diff between dispatch-time tree-walker checks and vtable-build-time cranelift checks). - Backend contract: the
Evaluatortrait — five&selfmethods covering one full evaluation lifecycle.
A backend (tree-walking relon_evaluator::TreeWalkEvaluator,
cranelift AOT, LLVM AOT, wasm host wrapper, …) implements this
single trait; hosts then hold a Box<dyn Evaluator> for dynamic
dispatch / backend swap.
Trait object-safety is a hard requirement: every method is &self plus
concrete in/out types — no generic methods.
Re-exports§
pub use capability::CapabilityGate;pub use context::Context;pub use context::GatedNativeFn;pub use context::LoadingModuleGuard;pub use decorator::DecoratorPlugin;pub use decorator::PreEvalOutcome;pub use error::RuntimeError;pub use module::ModuleResolver;pub use module::ModuleSource;pub use native_fn::EvaluatedArg;pub use native_fn::NativeArgs;pub use native_fn::NativeFn;pub use native_fn::NativeFnCaps;pub use native_fn::RelonFunction;pub use scope::ListContext;pub use scope::Locals;pub use scope::RootRef;pub use scope::Scope;pub use scope::Thunk;pub use scope::Thunks;pub use smol_str::SmolStr;pub use smol_str::SMOL_STR_INLINE_CAP;pub use value::ClosureData;pub use value::EnumSchemaData;pub use value::SchemaData;pub use value::SchemaField;pub use value::Value;pub use value::ValueDict;
Modules§
- buffer
- Typesafe writer + reader for the host <-> wasm binary handshake.
- capability
- Unified capability decision boundary across evaluator backends.
- context
- Shared evaluator context: host policy + sandbox state.
- decorator
- Decorator plugin protocol.
- error
- inplace_
return - Backend-shared host side of the in-place region-walk return ABI
(S1/S2
List<List<scalar>>, S3List<String>, S4List<Schema>, and pointer-array variant lists such asList<Enum>). When a compiled#mainreturns a parameter-sourced pointer-array list, the machine code does not copy the value intoout_buf. Instead the epilogue reports the arena-absolute offset of the return root via the negative sentinel-(root_abs + 1). The host then: - layout
- Static field-offset table for the host <-> wasm binary handshake.
- module
- Module resolution protocol.
- native_
fn - Native function interface exposed to host code.
- schema_
canonical - Deterministic schema serialisation + sha256 digest.
- schema_
lower relon_analyzer::SchemaDef->crate::schema_canonical::Schemaconversion.- scope
- Lexical and runtime context shared across evaluation steps.
- smol_
str - Short-string optimization (SSO) for
Value::String. - value
- verifier
- Host-walk bounds verifier for the binary handshake buffer.
Structs§
- Capabilities
- Context-wide sandbox policy the host hands the evaluator. The per-bit
booleans are the capabilities the host grants; per-function
requirements live on
NativeFnGate. A call goes through iff every bit declared on the fn’s gate is also set here — there is no per-name allowlist or global short-circuit, so a successful call proves that every bit on its gate was granted. - Native
FnGate - Capability requirements declared per native function at registration
time. The gate compares these against the context-wide
Capabilitiesgrant when the function is invoked under sandbox. - Resource
Budget - Evaluator-side resource budget.
Enums§
- Capability
Bit - Canonical assignment of capability bits to stable bit positions.
- Resource
Budget Profile - Evaluator-side resource-budget presets.
Traits§
- Evaluator
- Backend-agnostic evaluator contract.