Appearance
Surface Feature Matrix
This page turns syntax.md into a conservative implementation matrix backed by the current repo. It answers “what checks, executes, runs, or compiles today?” rather than “what the RFC eventually wants.”
Legend
check=aivi check/ syntax + HIR validation.execute=aivi execute/ one-shot non-GTK task entry (value main : Task ...).run=aivi run/ live GTK + runtime path.compile=aivi compile/ Cranelift object-code boundary only.yes= directly covered and currently working on that path.partial= accepted, but narrowed by same-module limits, provider-option gaps, runtime restrictions, or codegen slice limits.no= currently blocked or rejected on that path.n/a= not the intended delivery path for that surface.
Important scope notes
- The
compilecolumn does not mean “produces a runnable GTK binary”.aivi compilecurrently stops at object emission;aivi buildis the runnable bundle path. - The matrix is intentionally conservative. When docs and executable evidence differ, the lower status wins.
- The main evidence bases are:
crates/aivi-cli/tests/check.rscrates/aivi-cli/src/main.rscrates/aivi-cli/tests/compile.rscrates/aivi-backend/tests/foundations.rscrates/aivi-runtime/src/providers.rscrates/aivi-runtime/src/startup.rsmanual/guide/typeclasses.mdmanual/guide/source-catalog.mdcrates/aivi-backend/src/codegen.rs
Top-Level Forms
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
value / func | yes | yes | yes | yes | Core declaration surface is stable; later rows capture body-specific gaps. |
type aliases, records, and sums | yes | yes | yes | yes | Closed ADTs and records are broadly accepted across the pipeline. |
class / instance | yes | partial | partial | partial | Builtins and same-module user instances work; imported user-authored instances and imported polymorphic class-member execution remain deferred (manual/guide/typeclasses.md, crates/aivi-core/src/lower.rs). |
domain declarations and member lookup | yes | yes | yes | partial | Runtime foundation tests cover domain operators and authored members; codegen only supports a narrow representational slice (crates/aivi-backend/tests/foundations.rs, crates/aivi-backend/src/codegen.rs). |
Derived signal name = expr | yes | partial | yes | partial | The live runtime supports derived signals with reactive re-evaluation. aivi execute settles signals once and cannot observe subsequent derivations. Compile depends on the codegen slice used by the signal body expression. |
Body-less input signal name : Signal T | yes | partial | yes | yes | Input signals route GTK/runtime publications in run. aivi execute settles source-backed input signals once but cannot receive subsequent publications since it is not an interactive signal host. |
Built-in @source ... on a body-less signal | yes | partial | partial | partial | Broadly lowered and runtime-backed, but option-level support is intentionally narrower; see the source rows below and /guide/source-catalog. |
Custom provider qualified.name declarations | yes | no | no | partial | Contract checking and lowering exist, but the runtime provider manager still rejects unsupported/custom providers (crates/aivi-runtime/src/providers.rs). |
use / export for types and constructors | yes | yes | yes | yes | Workspace type imports are covered by passing run and compile tests. |
| Imported executable values across modules | yes | partial | partial | partial | Checking passes and the primary workspace-import compile test succeeds; coverage still narrows for cross-module values whose bodies use unsupported codegen forms. |
Top-level markup roots via value | yes | n/a | yes | n/a | run and build treat markup-valued top-level values as the deployment surface. |
Types And Literals
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
Core scalar types (Int, Float, Bool, Text, Unit) | yes | yes | yes | yes | Directly exercised across pure, runtime, and compile-safe tests. |
Extended scalar/runtime types (Decimal, BigInt, Bytes) | yes | yes | yes | partial | Literals compile as symbol-value pointers (Decimal/BigInt) or byte arrays (Bytes). Bytes equality and selected intrinsics (length, get, slice, fromText, repeat) compile. Decimal/BigInt arithmetic does not have dedicated Cranelift emission yet. |
Collection and effect types (List, Map, Set, Option, Result, Validation, Signal, Task) | yes | yes | yes | partial | List, Map, and Set literals compile via runtime constructor calls (aivi_list_new, aivi_set_new, aivi_map_new). Option niche/inline representation compiles. Aggregate operations (reduce, fold) and effect-type lowering (Signal, Task) remain outside the current codegen slice. |
| Partial type-constructor application / HKTs | yes | partial | partial | partial | Checked and same-module executable in the current higher-kinded slice, but not yet a general cross-module evidence system. |
Numeric literals (Int, Float, Decimal, BigInt) | yes | yes | yes | yes | All four numeric types have passing compile tests with verified Cranelift emission (Int/Float as immediates, Decimal/BigInt as symbol-value pointers). |
Domain suffix literals (250ms, 10sec, 3min) | yes | yes | yes | partial | Domain suffix literals compile as values. Domain member operations on suffixed values in gate/pipe contexts still hit codegen slice limits. |
| Text interpolation | yes | yes | yes | yes | Both static and dynamic text interpolation compile. Static interpolation folds at compile time; dynamic interpolation (e.g. "{host}/path" referencing a computed value) emits runtime text-concat calls (cranelift_codegen_compiles_interpolated_text). |
| Regex literals | yes | yes | yes | partial | Regex literals rx"..." evaluate to Text values representing the pattern string. Use with the aivi.regex module for runtime matching. Compile stays partial because regex-as-Text shares the text codegen path. |
| Record / tuple / list literals | yes | yes | yes | yes | Records and tuples compile for scalar and by-reference fields. List literals compile via aivi_list_new runtime constructor calls. |
Map { ... } / Set [ ... ] literals | yes | yes | yes | yes | Compile emits runtime constructor calls (aivi_list_new, aivi_set_new, aivi_map_new); element evaluation and stack marshalling are code-generated. |
Type-level record row transforms (Pick, Omit, Rename, Optional, Required, Defaulted) | yes | yes | yes | yes | These are type-surface features; once checking succeeds, the later runtime/compile path sees the elaborated shape. |
Default and record omission | yes | yes | yes | yes | Omission and defaults elaborate at check time, producing fully-specified records that compile through the standard aggregate codegen path. |
| Record shorthand | yes | yes | yes | yes | Shorthand desugars at check time before reaching the backend; resulting records compile successfully. |
Pipe Algebra And Expression Surface
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
Ambient subject (., .field, .field.subfield) | yes | yes | yes | yes | This is part of the stable checked/runtime expression surface. |
| Basic transform pipe ` | >` | yes | yes | yes | yes |
result { ... } | yes | yes | yes | partial | Checked and runtime-backed; compile still depends on the payload/body shapes used inside the block. |
| Gate `? | >` | yes | yes | yes | partial |
| Case split ` | >` | yes | yes | yes | |
| Truthy/falsy branches `T | >/F | >` | yes | yes | yes |
| Fan-out `* | >/ join< | *` | yes | yes | yes |
| Tap ` | ` | yes | yes | yes | partial |
| Debug stage | yes | yes | yes | yes | Runtime-backed debugging/logging stage. Codegen emits debug stages as no-op pass-throughs, preserving the pipeline subject value. |
| Validation stage `! | >` | yes | yes | yes | yes |
| Accumulation `+ | >` | yes | partial | yes | partial |
| Previous / diff `~ | >/- | >` | yes | partial | yes |
| Applicative clusters `& | >` | yes | yes | yes | partial |
| Explicit recurrence `@ | > ... < | @` | yes | no | partial |
Structural patch apply / patch { ... } | partial | partial | partial | partial | The checker accepts useful subsets, including list/map predicates and single-payload constructor focus. Codegen compiles single-segment named Replace and Remove patches (desugared to record construction). Complex selectors and nested patches are not yet supported. |
Patch removal field: - | yes | yes | yes | yes | The checker accepts patch removal and computes the result type via field omission. The runtime elaborator omits removed fields from the result record. Codegen compiles removal as desugared record construction. |
Signals, Tasks, And Sources
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
Top-level when reactive updates | yes | partial | yes | yes | Guarded, source-pattern, and pattern-armed when forms all compile and run. aivi execute fires when clauses once for initial signal values but cannot observe subsequent reactive updates since it is one-shot. |
Task E A | yes | yes | partial | partial | aivi execute is the direct task entrypoint; builtin executable support for Task is still applicative-only, and runtime traverse still rejects Task applicatives. |
timer.every / timer.after | yes | partial | yes | partial | immediate, jitter, and coalesce options are all supported. aivi execute fires once for the initial tick but is not a long-lived timer host. Compile depends on the codegen slice used by the timer body. |
http.get / http.post | yes | partial | yes | partial | Provider option support is broad: http.get accepts body (RFC 9110). aivi execute performs one request/response cycle; live streaming requires run. Compile is still request-slice specific. |
fs.watch / fs.read | yes | partial | yes | partial | fs.watch supports recursive: True for directory-tree watching. aivi execute performs one read/snapshot; continuous watching requires run. |
socket.connect | yes | partial | yes | partial | heartbeat is supported via periodic TCP keepalive writes. aivi execute opens one connection cycle; persistent socket streams require run. |
mailbox.subscribe | yes | partial | yes | partial | reconnect retries on disconnection; heartbeat publishes periodic Unit events. aivi execute receives one initial message; continuous subscription requires run. |
process.spawn | yes | partial | yes | partial | All three StreamMode values are supported: Ignore, Lines, and Bytes. aivi execute captures one output cycle; long-lived process streams require run. |
Host-context sources (process.args, process.cwd, env.get, stdio.read, path.*) | yes | yes | yes | partial | All host-context sources are immediate-value providers that resolve at startup via publish_immediate_value; they work identically in execute and run modes. Compile remains narrower than the runtime ABI. |
db.connect / db.live | yes | partial | yes | partial | optimistic and onRollback are accepted; pool is validated. aivi execute runs one query cycle; live subscriptions (db.live) require run. |
window.keyDown | yes | n/a | yes | partial | GTK-backed runtime tests exist; capture and focusOnly options are now accepted and stored for the GTK event controller. |
dbus.ownName / dbus.signal / dbus.method | yes | partial | partial | partial | Runtime tests exist. dbus.method supports reply with static GLib variant strings; dynamic runtime-computed reply payloads are not yet supported. |
Markup / GTK Surface
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
| Core markup roots and reactive attributes | yes | n/a | yes | n/a | prepare_run_artifact and bundle tests cover the current markup entry path. |
| Current widget catalog | yes | n/a | yes | n/a | The syntax-sheet catalog is supported; Button also exposes typed opacity: Float and animateOpacity: Bool properties for signal-driven fade transitions, but arbitrary non-catalog widgets and generic CSS-property maps are still rejected. |
| Event routing to input signals / payload publication | yes | n/a | partial | n/a | Direct signal hooks and payload-publishing event hooks are covered, but unsupported widget/event pairs are still rejected by the run surface. |
<show> | yes | n/a | yes | n/a | Covered by run/control-node tests. |
<each> | yes | n/a | yes | n/a | Covered by run/control-node tests and keyed collection handling. |
<match> | yes | n/a | yes | n/a | Covered by run/control-node tests and shared pattern machinery. |
<fragment> | yes | n/a | yes | n/a | Covered by run/control-node tests. |
<with> | yes | n/a | yes | n/a | Covered by run tests for markup-local bindings and payload-derived bindings. |
Patterns And Predicates
| Surface form | Check | Execute | Run | Compile | Notes |
|---|---|---|---|---|---|
| Constructor / wildcard / nested patterns | yes | yes | yes | partial | Runtime-backed; compile still loses coverage once those patterns lower through unsupported inline case/codegen paths. |
Record and list patterns ({ ... }, [], [x, ...rest]) | yes | yes | yes | partial | Checked and runtime-backed, but recursive list-pattern compile coverage is still incomplete (compile_rejects_recursive_list_pattern_fixture_with_cycle_error). |
Predicate mini-language (.field, and, or, not, ==, !=) | yes | yes | yes | partial | The checked/runtime slice is broad; compile still narrows when predicates rely on unsupported domain or inline-pipe codegen forms. |
Biggest Gaps
compileis a first-slice AOT boundary. It emits object code with runtime constructor imports for collection literals (aivi_list_new/aivi_set_new/aivi_map_new). Fan-out stages now have Cranelift loop emission but backend lowering still constrains general-expression fan-out. Text interpolation (both static and dynamic) now compiles end to end.- Inline-pipe
Case,TruthyFalsy, andTapstages now have Cranelift emission code but coverage is still narrower than the runtime pattern/carrier set. Previous/Difftemporal stages compile and work end to end for derived signals in the live runtime. General-expression contexts still block them (by design: temporal state requires a signal host).- Imported user-authored higher-kinded instances and imported polymorphic class-member execution are still deferred.
- Custom
providerdeclarations are currently contract/lowering features, not runtime-executable providers. - Regex literals
rx"..."evaluate to Text values and can be used in expression position. Use theaivi.regexmodule for runtime pattern matching. - Structural patch apply supports single-segment
Named ReplaceandNamed Removeon closed records. Replace substitutes the field value; Remove omits the field from the result record with a narrowed result type. More complex patch selectors and nested patches are not yet supported. - The source catalog is now broadly executed. The main remaining contract-only option is
dbus.methoddynamic runtime-computed reply payloads. Use/guide/source-catalogfor the option-level truth table.