Runtime and reference semantics
The parser accepts these forms. The schedulers and ownership checker are design work.
Parallel functions
@runtime(asynchronous)
parallel function load_certificate(location: Text) -> Text:
return wait read_certificate(location)
@runtime(threaded)
parallel function verify_certificate(source: Text) -> ProofOutcome:
return check_certificate(source)
The return type describes the completed result. Calling a parallel
function schedules a task and returns a typed handle. wait consumes that
handle and yields its result or propagates its failure. The @runtime
annotation selects the scheduler at compile time. The functions called in
the example stand for application or library functions.
| Runtime | Scheduling | Typical work |
|---|---|---|
asynchronous |
Cooperative tasks suspend on an event loop. wait yields control while its task is pending. |
I/O and orchestration |
threaded |
Tasks run on a bounded worker pool. wait suspends the task and frees its worker. |
CPU-bound proof search, checking, or evaluation |
Both modes use structured tasks. A parent owns its tasks until it joins them. A task failure cancels its siblings and the runtime waits for their cleanup before leaving the scope. Scheduling order may vary. Pure tasks with the same inputs have the same result. Proofs about elapsed time or scheduling need their own cost model. Machine clocks count native transitions.
Values and borrows
function inspect(borrow tape: Tape) -> TapeSymbol:
return first_symbol(borrow tape)
function rewrite(borrow mutable tape: Tape) -> NaturalNumbers:
return overwrite_guard(borrow mutable tape)
function inspect_input(input: Tape) -> TapeSymbol:
return inspect(borrow input)
- A plain parameter passes by value. Copyable values copy. Ownership of a noncopyable value transfers to the callee. Immutable values may share storage when their observable behavior stays the same.
borrowpasses a shared read-only reference for the call. Multiple readers may overlap. Ownership stays with the caller.borrow mutablepasses an exclusive writable reference. Other aliases cannot read or write the value while the borrow is active.- Borrows end when the call finishes. They cannot escape through a
return or stored value, survive a
wait, or enter a spawned task. Task boundaries accept owned values or copyable immutable values.