Skip to main content

Stmt

Enum Stmt 

Source
pub enum Stmt<'a> {
Show 86 variants Let { var: Symbol, ty: Option<&'a TypeExpr<'a>>, value: &'a Expr<'a>, mutable: bool, }, Set { target: Symbol, value: &'a Expr<'a>, }, Swap { a: Symbol, b: Symbol, }, Call { function: Symbol, args: Vec<&'a Expr<'a>>, }, If { cond: &'a Expr<'a>, then_block: Block<'a>, else_block: Option<Block<'a>>, }, While { cond: &'a Expr<'a>, body: Block<'a>, decreasing: Option<&'a Expr<'a>>, }, Repeat { pattern: Pattern, iterable: &'a Expr<'a>, body: Block<'a>, }, Return { value: Option<&'a Expr<'a>>, }, Break, Assert { proposition: &'a LogicExpr<'a>, }, Trust { proposition: &'a LogicExpr<'a>, justification: Symbol, }, RuntimeAssert { condition: &'a Expr<'a>, hard: bool, dim: Option<Dimension>, reason: Option<&'a Expr<'a>>, }, Fail { reason: &'a Expr<'a>, }, Give { object: &'a Expr<'a>, recipient: &'a Expr<'a>, }, Show { object: &'a Expr<'a>, recipient: &'a Expr<'a>, }, SetField { object: &'a Expr<'a>, field: Symbol, value: &'a Expr<'a>, }, StructDef { name: Symbol, fields: Vec<(Symbol, Symbol, bool)>, is_portable: bool, }, FunctionDef { name: Symbol, generics: Vec<Symbol>, params: Vec<(Symbol, &'a TypeExpr<'a>)>, body: Block<'a>, return_type: Option<&'a TypeExpr<'a>>, is_native: bool, native_path: Option<Symbol>, is_exported: bool, export_target: Option<Symbol>, opt_flags: OptimizationConfig, }, TestDef { name: Symbol, skip: Option<Symbol>, capabilities: TestCapabilities, budget: Option<u64>, cases: Option<CaseTable<'a>>, body: Block<'a>, }, Expect { condition: &'a Expr<'a>, }, ExpectFail { message: Option<Symbol>, body: Block<'a>, }, ExpectOutput { expected: ExpectedOutput, }, AdvanceTime { millis: &'a Expr<'a>, }, GivenFile { path: Symbol, content: Symbol, }, Observe { category: ObsCategory, message: Symbol, payloads: Vec<(Symbol, &'a Expr<'a>)>, sample: Option<u64>, }, During { label: Symbol, body: Block<'a>, }, ForAll { vars: Vec<Symbol>, domain: PropDomain, constraint: Option<&'a Expr<'a>>, body: Block<'a>, }, Inspect { target: &'a Expr<'a>, arms: Vec<MatchArm<'a>>, has_otherwise: bool, }, Push { value: &'a Expr<'a>, collection: &'a Expr<'a>, }, Pop { collection: &'a Expr<'a>, into: Option<Symbol>, }, Add { value: &'a Expr<'a>, collection: &'a Expr<'a>, }, Remove { value: &'a Expr<'a>, collection: &'a Expr<'a>, }, SetIndex { collection: &'a Expr<'a>, index: &'a Expr<'a>, value: &'a Expr<'a>, }, Splice { body: Block<'a>, }, Reversibly { body: Block<'a>, }, Zone { name: Symbol, capacity: Option<usize>, source_file: Option<ZoneSource>, body: Block<'a>, }, Concurrent { tasks: Block<'a>, }, Parallel { tasks: Block<'a>, }, ReadFrom { var: Symbol, source: ReadSource<'a>, }, WriteFile { content: &'a Expr<'a>, path: &'a Expr<'a>, }, Spawn { agent_type: Symbol, name: Symbol, }, SendMessage { message: &'a Expr<'a>, destination: &'a Expr<'a>, compression: Option<CompressionCodec>, cached: bool, unchecked: bool, layout: Option<SendLayout>, shared: bool, computed: bool, indexed: bool, deduped: bool, unreliable: bool, }, AwaitMessage { source: &'a Expr<'a>, into: Symbol, view: bool, stream: bool, }, StreamMessage { values: &'a Expr<'a>, destination: &'a Expr<'a>, }, MergeCrdt { source: &'a Expr<'a>, target: &'a Expr<'a>, }, JoinCrdt { source: &'a Expr<'a>, target: &'a Expr<'a>, }, IncreaseCrdt { object: &'a Expr<'a>, field: Symbol, amount: &'a Expr<'a>, }, DecreaseCrdt { object: &'a Expr<'a>, field: Symbol, amount: &'a Expr<'a>, }, AppendToSequence { sequence: &'a Expr<'a>, value: &'a Expr<'a>, }, ResolveConflict { object: &'a Expr<'a>, field: Symbol, value: &'a Expr<'a>, }, Check { subject: Symbol, predicate: Symbol, is_capability: bool, object: Option<Symbol>, source_text: String, span: Span, }, Listen { address: &'a Expr<'a>, secure: Option<SecurePad<'a>>, }, Serve { port: &'a Expr<'a>, handler: &'a Expr<'a>, }, ConnectTo { address: &'a Expr<'a>, secure: Option<SecurePad<'a>>, }, LetPeerAgent { var: Symbol, address: &'a Expr<'a>, }, Sleep { milliseconds: &'a Expr<'a>, }, Sync { var: Symbol, topic: &'a Expr<'a>, }, Ui(UiStmt<'a>), Fetch { method: FetchMethod, url: &'a Expr<'a>, body: Option<&'a Expr<'a>>, as_type: &'a TypeExpr<'a>, then: Symbol, }, Replay { actions: Vec<Symbol>, }, ServeFetches, GivenFetch { method: Symbol, url: &'a Expr<'a>, status: &'a Expr<'a>, body: &'a Expr<'a>, }, ComponentDef(Box<ComponentDef<'a>>), DirectiveDef { name: Symbol, params: Vec<(Symbol, &'a TypeExpr<'a>)>, body: Block<'a>, removed: Option<Block<'a>>, }, RouteDef { method: Symbol, path: Symbol, params: Vec<(Symbol, &'a TypeExpr<'a>)>, return_type: Option<&'a TypeExpr<'a>>, body: Box<RouteBody<'a>>, span: Span, }, MiddlewareDef { param: (Symbol, &'a TypeExpr<'a>), body: Block<'a>, }, RedirectDef { from: Symbol, to: Symbol, }, Mount { var: Symbol, path: &'a Expr<'a>, }, LaunchTask { function: Symbol, args: Vec<&'a Expr<'a>>, }, LaunchTaskWithHandle { handle: Symbol, function: Symbol, args: Vec<&'a Expr<'a>>, }, CreatePipe { var: Symbol, element_type: Symbol, capacity: Option<u32>, }, SendPipe { value: &'a Expr<'a>, pipe: &'a Expr<'a>, }, ReceivePipe { var: Symbol, pipe: &'a Expr<'a>, }, TrySendPipe { value: &'a Expr<'a>, pipe: &'a Expr<'a>, result: Option<Symbol>, }, TryReceivePipe { var: Symbol, pipe: &'a Expr<'a>, }, StopTask { handle: &'a Expr<'a>, }, CloseChannel { channel: &'a Expr<'a>, }, AwaitTask { handle: &'a Expr<'a>, result: Option<Symbol>, }, Select { branches: Vec<SelectBranch<'a>>, }, Theorem(TheoremBlock<'a>), Definition(DefinitionBlock<'a>), Axiom(AxiomBlock), Theory(TheoryBlock), Escape { language: Symbol, code: Symbol, span: Span, }, Require { crate_name: Symbol, version: Symbol, features: Vec<Symbol>, span: Span, }, Site(u32),
}

Variants§

§

Let

Variable binding: Let x be 5. or Let x: Int be 5.

Fields

§ty: Option<&'a TypeExpr<'a>>
§value: &'a Expr<'a>
§mutable: bool
§

Set

Mutation: Set x to 10.

Fields

§target: Symbol
§value: &'a Expr<'a>
§

Swap

Reversible register exchange: Swap x and y. — the canonical ZERO-GARBAGE reversible primitive (Op::RevSwap, its own inverse), the first LOGOS surface that emits the abelian reversible ISA. Exchanges the two variables’ values with no history-tape cost.

Fields

§

Call

Function call as statement: Call process with data.

Fields

§function: Symbol
§args: Vec<&'a Expr<'a>>
§

If

Conditional: If condition: ... Otherwise: ...

Fields

§cond: &'a Expr<'a>
§then_block: Block<'a>
§else_block: Option<Block<'a>>
§

While

Loop: While condition: ... or While condition (decreasing expr): ...

Fields

§cond: &'a Expr<'a>
§body: Block<'a>
§decreasing: Option<&'a Expr<'a>>

Optional decreasing variant for termination proof.

§

Repeat

Iteration: Repeat for x in list: ... or Repeat for i from 1 to 10: ...

Fields

§pattern: Pattern
§iterable: &'a Expr<'a>
§body: Block<'a>
§

Return

Return: Return x. or Return.

Fields

§value: Option<&'a Expr<'a>>
§

Break

Break: Break. — exits the innermost while loop.

§

Assert

Bridge to Logic Kernel: Assert that P.

Fields

§proposition: &'a LogicExpr<'a>
§

Trust

Documented assertion with justification. Trust that P because "reason". Semantics: Documented runtime check that could be verified statically.

Fields

§proposition: &'a LogicExpr<'a>
§justification: Symbol
§

RuntimeAssert

Runtime assertion with imperative condition. Assert that condition. (hard: false → debug_assert!, a development check) Require that condition. (hard: true → assert!, an enforced invariant that survives release — the form a proven property lowers to). dim is the physical dimension of a range contract whose literal quantity bounds the parser folded to SI magnitudes (Assume v is between 0.2 volts and 0.7 volts.) — metadata for static consumers (the analog lane); None for ordinary conditions. reason is the , otherwise <text> clause: why the contract exists, reported verbatim when it breaks and evaluated ONLY then. None reports Assertion failed.

Fields

§condition: &'a Expr<'a>
§hard: bool
§reason: Option<&'a Expr<'a>>
§

Fail

Fail with <reason>. — raise an error. With no Result to return it into and no Try: region around it, the program stops with reason as its report.

Fields

§reason: &'a Expr<'a>
§

Give

Ownership transfer (move): Give x to processor. Semantics: Move ownership of object to recipient.

Fields

§object: &'a Expr<'a>
§recipient: &'a Expr<'a>
§

Show

Immutable borrow: Show x to console. Semantics: Immutable borrow of object passed to recipient.

Fields

§object: &'a Expr<'a>
§recipient: &'a Expr<'a>
§

SetField

Field mutation: Set p's x to 10.

Fields

§object: &'a Expr<'a>
§field: Symbol
§value: &'a Expr<'a>
§

StructDef

Struct definition for codegen.

Fields

§name: Symbol
§fields: Vec<(Symbol, Symbol, bool)>
§is_portable: bool
§

FunctionDef

Function definition.

Fields

§name: Symbol
§generics: Vec<Symbol>

Generic type parameters: empty for monomorphic functions, e.g. [T, U] for polymorphic.

§params: Vec<(Symbol, &'a TypeExpr<'a>)>
§body: Block<'a>
§return_type: Option<&'a TypeExpr<'a>>
§is_native: bool
§native_path: Option<Symbol>

Rust path for user-defined native functions (e.g., “reqwest::blocking::get”). None for system native functions (read, write, etc.) which use map_native_function().

§is_exported: bool

Whether this function is exported for FFI (C ABI or WASM).

§export_target: Option<Symbol>

Export target: None = C ABI (#[no_mangle] extern “C”), Some(“wasm”) = #[wasm_bindgen].

§opt_flags: OptimizationConfig

Per-function optimization config: each ## No <X> annotation clears that optimization’s bit (default: all enabled).

§

TestDef

A ## Test: <prose sentence> block — an independent test entry point. The prose name is the test’s identity everywhere; duplicates in a module are a parse error. Ignored by normal execution; collected by the largo test runner.

Fields

§name: Symbol

The prose sentence after the colon, whitespace-normalized.

§skip: Option<Symbol>

Skip this test because "<reason>". — the mandatory reason.

§capabilities: TestCapabilities

Capability sentences granting real-world access (sealed by default).

§budget: Option<u64>

This test may run up to N steps. — op-budget escalation.

§cases: Option<CaseTable<'a>>

For each of these cases: + pipe table, when present.

§body: Block<'a>
§

Expect

Test-only assertion: Expect that <condition>. — records the failure and CONTINUES (a test reports every failed expectation, not just the first). Refused outside ## Test/## Example blocks.

Fields

§condition: &'a Expr<'a>
§

ExpectFail

Expect this to fail [with "<message>"]: — the only error-expectation form; the test FAILS if the block succeeds.

Fields

§message: Option<Symbol>
§body: Block<'a>
§

ExpectOutput

Expect output: — byte-exact stdout snapshot (in-document or golden file).

Fields

§

AdvanceTime

Advance time by <duration>. — moves the sealed world’s virtual clock (test-only; the statement that makes every timeout test instant).

Fields

§millis: &'a Expr<'a>

The advance in milliseconds.

§

GivenFile

Given a file "<path>" containing "<content>". — pre-seeds the sealed world’s in-memory filesystem (test-only).

Fields

§path: Symbol
§content: Symbol
§

Observe

An observation statement: `Note/Warn/Record that [with

and

]`. The that-clause is captured as the rendered `message`; payloads are the named values that travel with the event. Legal anywhere; emission is Wave 7.

Fields

§category: ObsCategory
§message: Symbol

The that-clause, rendered to text (the event’s stable message).

§payloads: Vec<(Symbol, &'a Expr<'a>)>

Prepositional payloads (with X and Y) — name → value expression.

§sample: Option<u64>

Deterministic counter-based sampling (Note once in every N times that …): emit 1-in-N. None = always. Sampling is a rendering decision, never an evidence decision (replay regenerates the rest).

§

During

During <gerund>: — a lexical trace span (no imperative start/stop, so a span can never leak). The body is ordinary code.

Fields

§label: Symbol

The span’s name (the gerund phrase or quoted literal), rendered.

§body: Block<'a>
§

ForAll

For all <domain> <vars> [where <cond>]: — a property test. The runner generates seeded cases, binds the vars, runs the body, and shrinks any counterexample. Test-only (like Expect).

Fields

§vars: Vec<Symbol>
§domain: PropDomain
§constraint: Option<&'a Expr<'a>>

Optional refinement filter (where n is greater than 0).

§body: Block<'a>
§

Inspect

Pattern matching on sum types.

Fields

§target: &'a Expr<'a>
§arms: Vec<MatchArm<'a>>
§has_otherwise: bool
§

Push

Push to collection: Push x to items.

Fields

§value: &'a Expr<'a>
§collection: &'a Expr<'a>
§

Pop

Pop from collection: Pop from items. or Pop from items into y.

Fields

§collection: &'a Expr<'a>
§

Add

Add to set: Add x to set.

Fields

§value: &'a Expr<'a>
§collection: &'a Expr<'a>
§

Remove

Remove from set: Remove x from set.

Fields

§value: &'a Expr<'a>
§collection: &'a Expr<'a>
§

SetIndex

Index assignment: Set item N of X to Y.

Fields

§collection: &'a Expr<'a>
§index: &'a Expr<'a>
§value: &'a Expr<'a>
§

Splice

A SCOPE-TRANSPARENT statement sequence — parser-desugar output, never written by users. One surface statement can lower to several primitive statements (a nested place-write Set item j of (item i of grid) to v becomes read → copy-on-write element write → write-back; a multi-push Push a, b, c to xs becomes one Push per element). The body runs in the ENCLOSING scope with no block of its own: temporaries inside are gensym’d (__place_*), so they can never collide with user names, and engines that execute blocks with scoping must NOT scope this one.

Fields

§body: Block<'a>
§

Reversibly

A REVERSIBLE / UNCOMPUTE block: Reversibly: (alias Uncompute:) introducing an indented body. Semantically TRANSPARENT — the body runs in the enclosing scope and produces byte-identical OUTPUT to the same statements outside the block. The only difference is the LOWERING: an IN-PLACE ABELIAN scalar update inside the body compiles to the zero-garbage reversible ISA (Op::RevAdd/RevSub/RevXor/RevNeg) instead of the plain journaling op, so Vm::run_reverse can undo the whole region with NO history tape (the adiabatic charge-recovery contract). Recognized in-place forms — where x is a local and e provably never observes x: Set x to x + e → RevAdd, Set x to x - e → RevSub, Set x to x xor e → RevXor, Set x to -x → RevNeg. Anything else in the body lowers exactly as it would outside the block.

Fields

§body: Block<'a>
§

Zone

Memory arena block (Zone). “Inside a new zone called ‘Scratch’:” “Inside a zone called ‘Buffer’ of size 1 MB:” “Inside a zone called ‘Data’ mapped from ‘file.bin’:”

Fields

§name: Symbol

The variable name for the arena handle (e.g., “Scratch”)

§capacity: Option<usize>

Optional pre-allocated capacity in bytes (Heap zones only)

§source_file: Option<ZoneSource>

Optional backing file for memory-mapped zones (literal path or runtime variable)

§body: Block<'a>

The code block executed within this memory context

§

Concurrent

Concurrent execution block (async, I/O-bound). “Attempt all of the following:” Semantics: All tasks run concurrently via tokio::join! Best for: network requests, file I/O, waiting operations

Fields

§tasks: Block<'a>

The statements to execute concurrently

§

Parallel

Parallel execution block (CPU-bound). “Simultaneously:” Semantics: True parallelism via rayon::join or thread::spawn Best for: computation, data processing, number crunching

Fields

§tasks: Block<'a>

The statements to execute in parallel

§

ReadFrom

Read from console or file. Read input from the console. or Read data from file "path.txt".

Fields

§source: ReadSource<'a>
§

WriteFile

Write to file. Write "content" to file "output.txt".

Fields

§content: &'a Expr<'a>
§path: &'a Expr<'a>
§

Spawn

Spawn an agent. Spawn a Worker called "w1".

Fields

§agent_type: Symbol
§name: Symbol
§

SendMessage

Send message to agent. Send Ping to "agent"., Send compressed Ping to "agent"., Send cached Point to "agent"., or Send cached compressed Report to "agent".

Fields

§message: &'a Expr<'a>
§destination: &'a Expr<'a>
§compression: Option<CompressionCodec>

The wire compression codec. None for a plain Send; Some(codec) for Send compressed [with <codec>] (bare compressed = deflate). Kept only if it actually shrinks the body.

§cached: bool

Send cached … — use the connection’s schema dictionary, so a struct schema is transmitted once and referenced thereafter (content-addressed, footgun-free). false for a plain Send.

§unchecked: bool

Send unchecked … — drop the wire integrity checksum for the fastest path (latency↔safety dial). false keeps the default checksum.

§layout: Option<SendLayout>

Send fast|compact|packed … — the wire LAYOUT (size↔speed dial). None is the default (compact / varint). The sender picks for their link.

§shared: bool

Send shared … — OPT-IN type-id elision: drop struct/enum NAMES off the wire (ship a small registry id both ends derive from their shared program type defs). Only safe when the receiver runs the same program, so it is OFF by default — the default Send stays self-describing for any peer / relay.

§computed: bool

Send computed f … — COMPUTE-SHIPPING: when the message is a pure single-arg function, lower it to a sandboxed generator and ship the COMPUTATION, not data. The receiver evaluates it in the bounded sandbox (never arbitrary code). OFF by default; a non-lowerable function under computed is rejected at send.

§indexed: bool

Send indexed … (alias addressable) — encode a record list in the random-access struct-view LAYOUT (row + field offset tables), so the receiver reaches any (row, field) in O(1) without decoding the rest — Cap’n Proto’s home turf. Composes with the other knobs (compressed, cached, shared, unchecked). OFF by default (the dense columnar form is smaller); opt in when the peer does random field reads.

§deduped: bool

Send deduped … — Rc-DEDUP: a subtree the same value reaches more than once ships ONCE (the first occurrence) plus a tiny backref for every repeat, and the receiver rebuilds the SHARING (one aliased value, not N copies). OFF by default; opt in when the message has shared sub-structure (a lookup table referenced by many records, one object aliased across the payload). Self-describing by tag, so any peer decodes it.

§unreliable: bool

Send unreliably … — the transport RELIABILITY dial: an unordered, best-effort datagram (may reorder or drop) instead of the reliable, ordered default. The media path pairs it with FEC so lossy frames recover without a retransmit stall. false is the default (reliable, ordered).

§

AwaitMessage

Await response from agent. Await response from "agent" into result.

Fields

§source: &'a Expr<'a>
§into: Symbol
§view: bool

Await view from …: hold a received record-list LAZILY (the zero-copy receive — decode-on-touch, no rows materialized until a field is read) instead of fully decoding it. Ignored for non-record-list shapes, which always decode eagerly.

§stream: bool

Await stream from …: receive a batch STREAM message and deframe it into a list (the values a peer Streamed), rather than a single message.

§

StreamMessage

Stream a batch of values to a peer in one framed message. Stream readings to "sink". — frames each element of values length-delimited so the receiver (Await stream from …) deframes them incrementally; one relay publish ships the whole batch (Kafka-style streaming that amortizes per-message overhead).

Fields

§values: &'a Expr<'a>
§destination: &'a Expr<'a>
§

MergeCrdt

Merge CRDT state. Merge remote into local. or Merge remote's field into local's field.

Fields

§source: &'a Expr<'a>
§target: &'a Expr<'a>
§

JoinCrdt

Converge CRDT state by the IDEMPOTENT lattice join — the sibling of Stmt::MergeCrdt. Converge remote into local. A bare-Int field takes per-field MAX (not ADD), so applying a redelivered state twice equals applying it once; counter/other fields defer to the same rule as Merge (already idempotent / last-writer-wins).

Fields

§source: &'a Expr<'a>
§target: &'a Expr<'a>
§

IncreaseCrdt

Increment GCounter. Increase local's points by 10.

Fields

§object: &'a Expr<'a>
§field: Symbol
§amount: &'a Expr<'a>
§

DecreaseCrdt

Decrement PNCounter (Tally). Decrease game's score by 5.

Fields

§object: &'a Expr<'a>
§field: Symbol
§amount: &'a Expr<'a>
§

AppendToSequence

Append to SharedSequence (RGA). Append "Hello" to doc's lines.

Fields

§sequence: &'a Expr<'a>
§value: &'a Expr<'a>
§

ResolveConflict

Resolve MVRegister conflicts. Resolve page's title to "Final".

Fields

§object: &'a Expr<'a>
§field: Symbol
§value: &'a Expr<'a>
§

Check

Security check - mandatory runtime guard. Check that user is admin. Check that user can publish the document. Semantics: NEVER optimized out. Panics if condition is false.

Fields

§subject: Symbol

The subject being checked (e.g., “user”)

§predicate: Symbol

The predicate name (e.g., “admin”) or action (e.g., “publish”)

§is_capability: bool

True if this is a capability check (can [action])

§object: Option<Symbol>

For capabilities: the object being acted on (e.g., “document”)

§source_text: String

Original English text for error message

§span: Span

Source location for error reporting

§

Listen

Listen on network address. Listen on "/ip4/127.0.0.1/tcp/8000". Semantics: Bind to address, start accepting connections via libp2p

Fields

§address: &'a Expr<'a>
§secure: Option<SecurePad<'a>>

Optional PNP one-time-pad binding: with pad "<path>" as initiator|responder.

§

Serve

Serve HTTP requests on a port with a handler function. Serve on port 8080 with handleRequest. Semantics: bind an HTTP server on the port and, per request, invoke the handler (a Request -> Response function) and write back its response.

Fields

§port: &'a Expr<'a>
§handler: &'a Expr<'a>
§

ConnectTo

Connect to remote peer. Connect to "/ip4/127.0.0.1/tcp/8000". Semantics: Dial peer via libp2p

Fields

§address: &'a Expr<'a>
§secure: Option<SecurePad<'a>>

Optional PNP one-time-pad binding: with pad "<path>" as initiator|responder.

§

LetPeerAgent

Create PeerAgent remote handle. Let remote be a PeerAgent at "/ip4/127.0.0.1/tcp/8000". Semantics: Create handle for remote agent communication

Fields

§address: &'a Expr<'a>
§

Sleep

Sleep for milliseconds. Sleep 1000. or Sleep delay. Semantics: Pause execution for N milliseconds (async)

Fields

§milliseconds: &'a Expr<'a>
§

Sync

Sync CRDT variable on topic. Sync x on "topic". Semantics: Subscribe to GossipSub topic, auto-publish on mutation, auto-merge on receive

Fields

§topic: &'a Expr<'a>
§

Ui(UiStmt<'a>)

One of the English things a component action DOES: an element verb, navigation, persistence, feedback, a store call, or a timer (UiStmt). First-class: every tier implements it natively rather than receiving a desugared builtin call.

§

Fetch

A typed request: Get URL as T, then action. / Post <body> to URL as T, then action. The completion action receives Result of T and HttpError — the decode is derived from as_type, and a non-2xx status becomes the Err side. No implicit retry.

Fields

§url: &'a Expr<'a>
§body: Option<&'a Expr<'a>>

The request body (Post <body> to …); None for Get / Delete.

§as_type: &'a TypeExpr<'a>
§then: Symbol

The action the response is delivered to.

§

Replay

Replay these actions: a, b, c. — re-run a sequence of the page’s actions, in order.

The journal’s reason for existing: a bug report becomes a test by naming the actions that produced it, and the dev panel’s time travel is this with a slider on it. Each one is a REAL TURN — it rolls back if it traps, it is journalled, and the page repaints — because a replay that bypassed the turn machinery would reproduce a different bug from the one being investigated.

Fields

§actions: Vec<Symbol>
§

ServeFetches

Serve fetches with routes. — answer the page’s requests from the program’s OWN routes.

The full-stack loop with no network: a Get "/api/todo" is answered by the matching ## Route, through the derived encoder on the way out and the derived decoder on the way back. That round trip is the only thing that can catch the two halves of the wire contract drifting apart — a stub answers with whatever the test author typed, which agrees with itself no matter what the encoder does.

A DECISION a test makes, never a default: a page whose fetches were silently answered by the local route table would pass tests that a deployed page fails, because in a browser nothing local answers anything.

§

GivenFetch

Given that METHOD "/url" answers STATUS with BODY. — how a test answers a fetch.

The sealed-world rule the rest of the suite follows: a page test must not depend on a network, and a page whose data never arrives is a page that proves nothing. Matched by method AND url together, because a stub that answered the wrong request is how a test ends up proving something nobody asked for.

Fields

§method: Symbol
§url: &'a Expr<'a>
§status: &'a Expr<'a>
§body: &'a Expr<'a>
§

ComponentDef(Box<ComponentDef<'a>>)

An LGX page / component / store / error page — the component model, first-class (see crate::ast::component). Every tier implements it natively.

§

DirectiveDef

## Directive name (el: Element) and (value: T): — a custom attribute behavior: body runs when the attribute appears on an element and whenever its value changes; removed (a When removed: block) runs when the element leaves.

Fields

§name: Symbol
§params: Vec<(Symbol, &'a TypeExpr<'a>)>
§body: Block<'a>
§removed: Option<Block<'a>>
§

RouteDef

## Route METHOD /path (params) -> T: — a typed HTTP route.

Fields

§method: Symbol
§path: Symbol
§params: Vec<(Symbol, &'a TypeExpr<'a>)>
§return_type: Option<&'a TypeExpr<'a>>
§body: Box<RouteBody<'a>>

★ BOXED, AND THE REASON IS THE WHOLE NODE’S SIZE. RouteBody is 88 bytes, which made RouteDef 144 — the single widest Stmt variant, and therefore the size of EVERY Stmt. compiler_stack_safety_lock::ast_nodes_stay_small holds the node to 128 bytes because the compiler walk keeps many per frame, so widening it multiplies stack use across every tier. A route’s body is the rare payload and does not belong inline; ComponentDef next door is boxed for the same reason.

§span: Span

Where the route was declared. A ## Route is refused for reasons the author has to go and look at — a parameter type the path matcher cannot bind, an answer type the derived codecs do not cover — and those refusals had nowhere to point.

§

MiddlewareDef

## Before each request (request: Request) -> Option of Response: — middleware.

Fields

§param: (Symbol, &'a TypeExpr<'a>)
§body: Block<'a>
§

RedirectDef

## Redirect /from -> /to.

Fields

§from: Symbol
§

Mount

Mount persistent CRDT from journal file. Mount counter at "data/counter.journal". Semantics: Load or create journal, replay operations to reconstruct state

Fields

§var: Symbol

The variable name for the mounted value

§path: &'a Expr<'a>

The path expression for the journal file

§

LaunchTask

Launch a fire-and-forget task (green thread). Launch a task to process(data). Semantics: tokio::spawn with no handle capture

Fields

§function: Symbol

The function to call

§args: Vec<&'a Expr<'a>>

Arguments to pass

§

LaunchTaskWithHandle

Launch a task with handle for control. Let worker be Launch a task to process(data). Semantics: tokio::spawn returning JoinHandle

Fields

§handle: Symbol

Variable to bind the handle

§function: Symbol

The function to call

§args: Vec<&'a Expr<'a>>

Arguments to pass

§

CreatePipe

Create a bounded channel (pipe). Let jobs be a new Pipe of Int. Semantics: tokio::sync::mpsc::channel(32)

Fields

§var: Symbol

Variable for the pipe

§element_type: Symbol

Type of values in the pipe

§capacity: Option<u32>

Optional capacity (defaults to 32)

§

SendPipe

Blocking send into pipe. Send value into pipe. Semantics: pipe_tx.send(value).await

Fields

§value: &'a Expr<'a>

The value to send

§pipe: &'a Expr<'a>

The pipe to send into

§

ReceivePipe

Blocking receive from pipe. Receive x from pipe. Semantics: let x = pipe_rx.recv().await

Fields

§var: Symbol

Variable to bind the received value

§pipe: &'a Expr<'a>

The pipe to receive from

§

TrySendPipe

Non-blocking send (try). Try to send value into pipe. Semantics: pipe_tx.try_send(value) - returns immediately

Fields

§value: &'a Expr<'a>

The value to send

§pipe: &'a Expr<'a>

The pipe to send into

§result: Option<Symbol>

Variable to bind the result (true/false)

§

TryReceivePipe

Non-blocking receive (try). Try to receive x from pipe. Semantics: pipe_rx.try_recv() - returns Option

Fields

§var: Symbol

Variable to bind the received value (if any)

§pipe: &'a Expr<'a>

The pipe to receive from

§

StopTask

Cancel a spawned task. Stop worker. Semantics: handle.abort()

Fields

§handle: &'a Expr<'a>

The handle to cancel

§

CloseChannel

Close a channel (pipe). Close ch. or Close the pipe ch. Semantics: mark the channel closed so pending/future receivers wake with the closed signal (Op::ChanClose). Buffered values stay receivable; a later send is the error. The deterministic-scheduler sibling of Stop for tasks.

Fields

§channel: &'a Expr<'a>

The channel to close

§

AwaitTask

Await a spawned task handle’s completion. Await worker. or Wait for worker. (optionally … into result). Semantics: park until the task finishes, taking its result (Op::TaskAwait). The join sibling of Stop (which cancels) — this waits for and observes the child’s completion.

Fields

§handle: &'a Expr<'a>

The task handle to join.

§result: Option<Symbol>

Optional binding for the task’s result (… into r); None discards it.

§

Select

Select on multiple channels/timeouts. Await the first of: Receive x from ch: ... After 5 seconds: ... Semantics: tokio::select! with auto-cancel

Fields

§branches: Vec<SelectBranch<'a>>

The branches to select from

§

Theorem(TheoremBlock<'a>)

Theorem block. ## Theorem: Name Given: Premise. Prove: Goal. Proof: Auto.

§

Definition(DefinitionBlock<'a>)

## Define block — a vernacular-logic predicate definition (Rung 0a). x is a bachelor if and only if x is unmarried and x is a man. Non-executable: like Stmt::Theorem, it is a declaration the proof layer consumes, not code the VM/AOT runs.

§

Axiom(AxiomBlock)

## Axiom block — a named first-order axiom in formal notation. Registers a shared premise for later theorems (the seam for an axiomatic base like Tarski).

§

Theory(TheoryBlock)

## Theory block — a named development grouping formal axioms and theorems.

§

Escape

Escape hatch: embed raw foreign code. Escape to Rust: followed by an indented block of raw code.

Variables from the enclosing LOGOS scope are available in the escape block as their generated Rust types. The raw code is emitted verbatim inside a { ... } block in the generated Rust.

Fields

§language: Symbol

Target language (“Rust” for now, forward-compatible with “Python”, “WGSL”, etc.)

§code: Symbol

Raw foreign code, captured verbatim with base indentation stripped.

§span: Span

Source span covering the entire escape block (header + body).

§

Require

Dependency declaration from ## Requires block. The “serde” crate version “1.0” with features “derive”.

Fields

§crate_name: Symbol
§version: Symbol
§features: Vec<Symbol>
§span: Span
§

Site(u32)

★ A RUNTIME FAILURE-SITE MARKER (Wave 3: “runtime failures carry a location”) — no Stmt variant carries a span (this one included: its OWN payload is an opaque id, not a span), so a trap deep inside an action’s body has never been able to say WHERE in the source it happened. This is the fix, and it is a MARKER rather than a span field on every Stmt variant on purpose: giving every variant a span is a schema change touching every constructor and every exhaustive match in the workspace for a span most of them never need (a Let inside a ## Main that never fails costs nothing to leave unmarked). A Site(id) is inserted as its OWN statement, immediately before the sentence it marks, by Parser::parse_indented_block whenever Parser::site_tracking names a component and action — so it travels through the ordinary statement pipeline into every backend’s own compiled form (bytecode, wasm, C, …) exactly like any other statement, which a parse-time- only side table (Parser::stmt_spans) cannot: that table is gone by the time a COMPILED program traps at runtime, and stmt_spans covers only top-level statements besides.

id indexes Parser::failure_sites (built as each marker is inserted) for the (file, span, component, action) it names. Every backend that runs a Stmt must accept this variant in an EXPLICIT arm, not a wildcard — this file’s own doc history is full of wildcard arms that silently swallowed a case nobody noticed was reachable; a backend with nothing to do here yet says so by name (Stmt::Site(_) => {} or equivalent), so the day it DOES need to do something, the compiler — not a bug report — is what tells whoever adds a new backend that this one still needs it. The tree-walker’s job with it is the simplest one there is: current site = id (FailureSite’s own doc comment says why this is enough for a location); every OTHER backend, not yet given a reason to do more, ignores it explicitly and moves on.

Trait Implementations§

Source§

impl<'a> Clone for Stmt<'a>

Source§

fn clone(&self) -> Stmt<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Stmt<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Stmt<'a>

§

impl<'a> RefUnwindSafe for Stmt<'a>

§

impl<'a> Send for Stmt<'a>

§

impl<'a> Sync for Stmt<'a>

§

impl<'a> Unpin for Stmt<'a>

§

impl<'a> UnsafeUnpin for Stmt<'a>

§

impl<'a> UnwindSafe for Stmt<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,