Skip to main content

Crate runlet

Crate runlet 

Source
Expand description

Runlet’s executable semantic model.

The runtime keeps deterministic values and ordered results while allowing bounded loop subgraphs to execute concurrently. Durable journals and remote production executors remain later phases described in DESIGN.md.

§Quick start

use runlet::{CanonicalValue, Runtime};

let runtime = Runtime::builder().with_prelude().build()?;
let program = runtime.compile(r#"return text.upper("runlet")"#)
    .expect("valid Runlet source");
let execution = runtime.run(&program)?;

assert_eq!(execution.value, CanonicalValue::from("RUNLET"));

Structs§

Block
Lexically scoped sequence of statements ending in a result expression.
CallSchema
Ordered parameter schema for a tool call.
CompiledProgram
A parsed and schema-checked program ready for execution.
Diagnostic
Structured parse, analysis, planning, or execution feedback.
Edge
Directed relationship in an execution graph.
Execution
Final value and execution graph from a successful run.
Expr
Source expression and its location.
ExternalInput
A named value supplied by the host and available to a Runlet program.
Fix
A source edit that may resolve a diagnostic.
Graph
Snapshot of nodes and edges produced by one execution.
GraphEvent
An ordered, incremental change to a running execution graph.
Healed
Source produced by a successful mechanical repair pass.
Node
A unit of work or value in an execution graph.
Program
Parsed Runlet compilation unit.
Property
Schema and host metadata for an object property.
Runtime
Immutable compiler and in-process executor configured by RuntimeBuilder.
RuntimeBuilder
Builder for a Runtime and its complete host capability surface.
Span
Half-open byte range in the original UTF-8 source.
Stmt
Source statement and its location.
ToolContext
Metadata supplied to a host tool handler for one dispatch attempt.
ToolDescriptor
Host-facing declaration of a callable tool.
ToolError
Structured failure returned by a tool handler or the runtime.
ToolRegistry
Deterministically ordered collection of tool descriptors.

Enums§

BinaryOp
Infix binary operator.
CanonicalValue
Deterministic runtime value representation used throughout Runlet.
EdgeKind
Relationship between two execution graph nodes.
ExecutionPolicy
Effect and retry semantics declared by a host tool.
ExprKind
Kind-specific expression data.
GraphChange
Mutation emitted while an execution graph is built.
NodeKind
Semantic role of a node in an execution graph.
NodeState
Lifecycle state of an execution graph node.
ObjectKey
An object-literal property key: written literally (name: / "name":) or computed at runtime ([expr]:). Computed keys evaluate to a string; scalar values (integers, numbers, booleans) convert to their canonical text form. When keys collide, the last entry wins.
Phase
Pipeline phase that produced a diagnostic.
Schema
Runtime value schema used to validate inputs and analyze programs.
Severity
Diagnostic importance.
StmtKind
Kind-specific statement data.
UnaryOp
Prefix unary operator.
ValueError
Failure while constructing or serializing a canonical value.

Constants§

LANGUAGE_VERSION
Language semantic version implemented by this crate.
VALUE_ENCODING_VERSION
Canonical value encoding version implemented by this crate.

Functions§

compile
Parses and analyzes source against a tool registry and host inputs.
heal
Attempts to repair source so it parses. Returns None when the source already parses, when no rule applies, or when healing does not converge.
parse
Parses Runlet source into its syntax tree.