Documentation

Async, composition and contracts

Every operator a .lolo program can call, from the canonical registry the compiler bakes.

Namespaces on this page: async/, behavior/, checkpoint/, compose/, contract/, integration/, trace/.

async/

async/all

Execute effects in parallel, wait for all to complete

lolo
1 (async/all ...effects)

Parameters

NameTypeDescription
...effectsexpression[]Effects to execute

Returns: array · Runs on: any

Example

lolo
1 (async/all (call "api1") (call "api2"))

async/debounce

Debounce an event (wait for pause in events)

lolo
1 (async/debounce event ms)

Parameters

NameTypeDescription
eventstringEvent name to emit
msnumberDebounce delay in milliseconds

Returns: void · Runs on: any

Example

lolo
1 (async/debounce "SEARCH" 300)

async/delay

Wait for specified milliseconds, optionally execute an effect after

lolo
1 (async/delay ms)

Parameters

NameTypeDescription
msnumberMilliseconds to wait

Returns: any · Runs on: any

Example

lolo
1 (async/delay 2000) // Wait 2 seconds

async/interval

Execute an effect periodically at a fixed interval

lolo
1 (async/interval effect interval)

Parameters

NameTypeDescription
effectanyEffect to execute
intervalnumberInterval in milliseconds

Returns: string · Runs on: any

Example

lolo
1 (async/interval (log "tick") 1000) // => "id-123"

async/race

Execute effects in parallel, return first to complete

lolo
1 (async/race ...effects)

Parameters

NameTypeDescription
...effectsexpression[]Effects to race

Returns: any · Runs on: any

Example

lolo
1 (async/race (call "api1") (call "api2"))

async/retry

Retry an effect with configurable backoff

lolo
1 (async/retry effect opts)

Parameters

NameTypeDescription
effectexpressionEffect to retry
optsobject{ attempts, backoff, baseDelay }

Returns: any · Runs on: any

Example

lolo
1 (async/race ["call","api1"] ["call","api2"])

async/sequence

Execute effects in sequence (one after another)

lolo
1 (async/sequence ...effects)

Parameters

NameTypeDescription
...effectsexpression[]Effects to execute in order

Returns: array · Runs on: any

Example

lolo
1 (async/sequence (call "validate") (call "save"))

async/throttle

Throttle an event (emit at most once per interval)

lolo
1 (async/throttle event ms)

Parameters

NameTypeDescription
eventstringEvent name to emit
msnumberThrottle interval in milliseconds

Returns: void · Runs on: any

Example

lolo
1 (async/throttle "SCROLL" 100)

async/timeout

Add timeout to an effect

lolo
1 (async/timeout effect ms)

Parameters

NameTypeDescription
effectexpressionEffect to execute
msnumberTimeout in milliseconds

Returns: any · Runs on: any

Example

lolo
1 (async/timeout (call "api" "fetchData") 5000)

behavior/

behavior/call

Call a behavior service action. Returns the ServiceCallResult union — resolves to the specific member when the (behavior, action) pair is a literal.

lolo
1 (behavior/call behavior action)

Parameters

NameTypeDescription
behaviorstringBehavior name
actionstringAction name (variadic)

Returns: ServiceCallResult · Runs on: any

Example

lolo
1 (behavior/call "user-service" "login")

behavior/compose

Compose N orbitals into one application schema. Wires events, picks layout, generates pages.

lolo
1 (behavior/compose orbitals)

Parameters

NameTypeDescription
orbitalsarrayArray of orbital definitions

Returns: object

Example

lolo
1 (behavior/compose [{"name": "home"} {"name": "settings"}])

behavior/detect-layout

Auto-detect layout from orbital count and wiring topology. Returns single, tabs, sidebar, dashboard, or wizard-flow.

lolo
1 (behavior/detect-layout orbitals)

Parameters

NameTypeDescription
orbitalsarrayArray of orbitals (variadic)

Returns: string

Example

lolo
1 (behavior/detect-layout [{"name": "a"} {"name": "b"}]) // => "tabs"

behavior/instantiate

Instantiate a behavior from the registry at runtime (meta-programming). Equivalent to compile-time uses but dynamic — the behavior name is a runtime value. Applies the same override surface (linkedEntity, events, config, fields).

lolo
1 (behavior/instantiate behavior config)

Parameters

NameTypeDescription
behaviorstringBehavior name
configobjectConfiguration object (variadic)

Returns: BuilderResult · Runs on: any

Example

lolo
1 (behavior/instantiate "my-behavior" {})

behavior/pipe

Left-to-right composition. Each step receives the previous result as its first arg.

lolo
1 (behavior/pipe value fn)

Parameters

NameTypeDescription
valueanyInitial value
fnlambdaTransform function (variadic)

Returns: any

Example

lolo
1 (behavior/pipe 5 (fn x (+ "x" 1))) // => 6

behavior/wire

Apply cross-orbital event wiring. Adds external emits/listens to inline traits.

lolo
1 (behavior/wire traits routes)

Parameters

NameTypeDescription
traitsarrayArray of traits
routesarrayArray of event routes

Returns: array

Example

lolo
1 (behavior/wire [{"name": "t1"} {"name": "t2"}] [])

checkpoint/

checkpoint/load

Load a model checkpoint (ML effect)

lolo
1 (checkpoint/load path)

Parameters

NameTypeDescription
pathstringCheckpoint path

Returns: object

Example

lolo
1 (checkpoint/load "model-v1") // => {}

checkpoint/save

Save a model checkpoint (ML effect)

lolo
1 (checkpoint/save model path)

Parameters

NameTypeDescription
modelobjectModel object
pathstringCheckpoint path

Returns: void · Runs on: any

Example

lolo
1 (checkpoint/save {"layers":[{"type":"dense","units":2}]} "ckpt-1")

compose/

compose/compose-all

Compose all orbitals in the workspace into a single schema. Backed by composeBehaviors.

lolo
1 (compose/compose-all)

Returns: ComposeAllResult · Runs on: any

Example

lolo
1 (compose/compose-all) // => {}

compose/compose-children

Compose child orbitals under a parent for recursive builds.

lolo
1 (compose/compose-children parent)

Parameters

NameTypeDescription
parentobjectParent orbital

Returns: ComposeChildrenResult · Runs on: any

Example

lolo
1 (compose/compose-children "GameScreenOrbital") // => {}

contract/

contract/clamp-output

Clamp output tensor to contract ranges

lolo
1 (contract/clamp-output tensor ranges)

Parameters

NameTypeDescription
tensoranyOutput tensor
rangesobjectRange constraints

Returns: tensor

Example

lolo
1 (contract/clamp-output [1 2 3] {"min": 0, "max": 255}) // => [1 2 3]

contract/entity-to-tensor

Convert entity fields to tensor via contract

lolo
1 (contract/entity-to-tensor entity contract)

Parameters

NameTypeDescription
entityobjectEntity object
contractobjectContract schema

Returns: tensor

Example

lolo
1 (contract/entity-to-tensor {"price":10,"qty":2} {"fields":["price","qty"]}) // => []

contract/tensor-to-payload

Convert output tensor to event payload via contract

lolo
1 (contract/tensor-to-payload tensor contract)

Parameters

NameTypeDescription
tensoranyOutput tensor
contractobjectContract schema

Returns: object

Example

lolo
1 (contract/tensor-to-payload [0.5,0.7] {"fields":["price","qty"]}) // => {}

contract/validate-input

Validate tensor against input contract. Returns { valid, violations } — guard on valid, or read violations for the detail.

lolo
1 (contract/validate-input tensor contract)

Parameters

NameTypeDescription
tensoranyInput tensor
contractobjectContract schema

Returns: object

Example

lolo
1 (contract/validate-input [0.5,0.7] {"ranges":{"0":{"min":0,"max":1},"1":{"min":0,"max":1}}}) // => {"valid": true, "violations": []}

contract/validate-output

Validate tensor against output contract. Returns { valid, violations } — guard on valid, or read violations for the detail.

lolo
1 (contract/validate-output tensor contract)

Parameters

NameTypeDescription
tensoranyOutput tensor
contractobjectContract schema

Returns: object

Example

lolo
1 (contract/validate-output [0.5,0.7] {"ranges":{"0":{"min":0,"max":1},"1":{"min":0,"max":1}}}) // => {"valid": true, "violations": []}

contract/violations

List contract violations

lolo
1 (contract/violations tensor contract)

Parameters

NameTypeDescription
tensoranyTensor
contractobjectContract schema

Returns: array

Example

lolo
1 (contract/violations [0.5,1.7] {"ranges":{"0":{"min":0,"max":1},"1":{"min":0,"max":1}}}) // => []

integration/

integration/github-create-issue

Create a GitHub issue. Typed wrapper for the GitHub API.

lolo
1 (integration/github-create-issue repo title body)

Parameters

NameTypeDescription
repostringRepository identifier
titlestringIssue title
bodystringIssue description

Returns: object · Runs on: any

Example

lolo
1 (integration/github-create-issue "owner/repo" "Bug found" "Details here")

integration/github-get-repo

Get a GitHub repository. Typed wrapper for the GitHub API.

lolo
1 (integration/github-get-repo owner repo)

Parameters

NameTypeDescription
ownerstringRepository owner
repostringRepository name

Returns: object · Runs on: any

Example

lolo
1 (integration/github-get-repo "microsoft" "vscode")

integration/http

HTTP request with caller-declared response schema. Validates the response against the schema before returning.

lolo
1 (integration/http method url body)

Parameters

NameTypeDescription
methodstringHTTP method
urlstringRequest URL
bodyanyRequest body or config (variadic)

Returns: object · Runs on: any

Example

lolo
1 (integration/http "GET" "https://api.example.com/data")

trace/

trace/emit

Emit a structured trace event for observability (115 call sites in rabit today).

lolo
1 (trace/emit event)

Parameters

NameTypeDescription
eventstringEvent name

Returns: void · Runs on: any

Example

lolo
1 (trace/emit "cache-hit")

trace/log

Log a message at the given level.

lolo
1 (trace/log level msg)

Parameters

NameTypeDescription
levelstringLog level
msgstringMessage text

Returns: void · Runs on: any

Example

lolo
1 (trace/log "info" "Processing started")
Orb

The language where the rule is the program.

© 2026 Almadar. Ljubljana, Slovenia.