Skip to content

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 compile column does not mean “produces a runnable GTK binary”. aivi compile currently stops at object emission; aivi build is 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.rs
    • crates/aivi-cli/src/main.rs
    • crates/aivi-cli/tests/compile.rs
    • crates/aivi-backend/tests/foundations.rs
    • crates/aivi-runtime/src/providers.rs
    • crates/aivi-runtime/src/startup.rs
    • manual/guide/typeclasses.md
    • manual/guide/source-catalog.md
    • crates/aivi-backend/src/codegen.rs

Top-Level Forms

Surface formCheckExecuteRunCompileNotes
value / funcyesyesyesyesCore declaration surface is stable; later rows capture body-specific gaps.
type aliases, records, and sumsyesyesyesyesClosed ADTs and records are broadly accepted across the pipeline.
class / instanceyespartialpartialpartialBuiltins 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 lookupyesyesyespartialRuntime 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 = expryespartialyespartialThe 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 TyespartialyesyesInput 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 signalyespartialpartialpartialBroadly lowered and runtime-backed, but option-level support is intentionally narrower; see the source rows below and /guide/source-catalog.
Custom provider qualified.name declarationsyesnonopartialContract 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 constructorsyesyesyesyesWorkspace type imports are covered by passing run and compile tests.
Imported executable values across modulesyespartialpartialpartialChecking 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 valueyesn/ayesn/arun and build treat markup-valued top-level values as the deployment surface.

Types And Literals

Surface formCheckExecuteRunCompileNotes
Core scalar types (Int, Float, Bool, Text, Unit)yesyesyesyesDirectly exercised across pure, runtime, and compile-safe tests.
Extended scalar/runtime types (Decimal, BigInt, Bytes)yesyesyespartialLiterals 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)yesyesyespartialList, 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 / HKTsyespartialpartialpartialChecked 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)yesyesyesyesAll 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)yesyesyespartialDomain suffix literals compile as values. Domain member operations on suffixed values in gate/pipe contexts still hit codegen slice limits.
Text interpolationyesyesyesyesBoth 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 literalsyesyesyespartialRegex 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 literalsyesyesyesyesRecords and tuples compile for scalar and by-reference fields. List literals compile via aivi_list_new runtime constructor calls.
Map { ... } / Set [ ... ] literalsyesyesyesyesCompile 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)yesyesyesyesThese are type-surface features; once checking succeeds, the later runtime/compile path sees the elaborated shape.
Default and record omissionyesyesyesyesOmission and defaults elaborate at check time, producing fully-specified records that compile through the standard aggregate codegen path.
Record shorthandyesyesyesyesShorthand desugars at check time before reaching the backend; resulting records compile successfully.

Pipe Algebra And Expression Surface

Surface formCheckExecuteRunCompileNotes
Ambient subject (., .field, .field.subfield)yesyesyesyesThis is part of the stable checked/runtime expression surface.
Basic transform pipe `>`yesyesyesyes
result { ... }yesyesyespartialChecked and runtime-backed; compile still depends on the payload/body shapes used inside the block.
Gate `?>`yesyesyespartial
Case split `>`yesyesyes
Truthy/falsy branches `T>/F>`yesyesyes
Fan-out `*>/ join<*`yesyesyes
Tap ``yesyesyespartial
Debug stageyesyesyesyesRuntime-backed debugging/logging stage. Codegen emits debug stages as no-op pass-throughs, preserving the pipeline subject value.
Validation stage `!>`yesyesyesyes
Accumulation `+>`yespartialyespartial
Previous / diff `~>/->`yespartialyes
Applicative clusters `&>`yesyesyespartial
Explicit recurrence `@> ... <@`yesnopartial
Structural patch apply / patch { ... }partialpartialpartialpartialThe 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: -yesyesyesyesThe 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 formCheckExecuteRunCompileNotes
Top-level when reactive updatesyespartialyesyesGuarded, 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 Ayesyespartialpartialaivi 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.afteryespartialyespartialimmediate, 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.postyespartialyespartialProvider 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.readyespartialyespartialfs.watch supports recursive: True for directory-tree watching. aivi execute performs one read/snapshot; continuous watching requires run.
socket.connectyespartialyespartialheartbeat is supported via periodic TCP keepalive writes. aivi execute opens one connection cycle; persistent socket streams require run.
mailbox.subscribeyespartialyespartialreconnect retries on disconnection; heartbeat publishes periodic Unit events. aivi execute receives one initial message; continuous subscription requires run.
process.spawnyespartialyespartialAll 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.*)yesyesyespartialAll 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.liveyespartialyespartialoptimistic and onRollback are accepted; pool is validated. aivi execute runs one query cycle; live subscriptions (db.live) require run.
window.keyDownyesn/ayespartialGTK-backed runtime tests exist; capture and focusOnly options are now accepted and stored for the GTK event controller.
dbus.ownName / dbus.signal / dbus.methodyespartialpartialpartialRuntime tests exist. dbus.method supports reply with static GLib variant strings; dynamic runtime-computed reply payloads are not yet supported.

Markup / GTK Surface

Surface formCheckExecuteRunCompileNotes
Core markup roots and reactive attributesyesn/ayesn/aprepare_run_artifact and bundle tests cover the current markup entry path.
Current widget catalogyesn/ayesn/aThe 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 publicationyesn/apartialn/aDirect signal hooks and payload-publishing event hooks are covered, but unsupported widget/event pairs are still rejected by the run surface.
<show>yesn/ayesn/aCovered by run/control-node tests.
<each>yesn/ayesn/aCovered by run/control-node tests and keyed collection handling.
<match>yesn/ayesn/aCovered by run/control-node tests and shared pattern machinery.
<fragment>yesn/ayesn/aCovered by run/control-node tests.
<with>yesn/ayesn/aCovered by run tests for markup-local bindings and payload-derived bindings.

Patterns And Predicates

Surface formCheckExecuteRunCompileNotes
Constructor / wildcard / nested patternsyesyesyespartialRuntime-backed; compile still loses coverage once those patterns lower through unsupported inline case/codegen paths.
Record and list patterns ({ ... }, [], [x, ...rest])yesyesyespartialChecked 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, ==, !=)yesyesyespartialThe checked/runtime slice is broad; compile still narrows when predicates rely on unsupported domain or inline-pipe codegen forms.

Biggest Gaps

  • compile is 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, and Tap stages now have Cranelift emission code but coverage is still narrower than the runtime pattern/carrier set.
  • Previous/Diff temporal 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 provider declarations are currently contract/lowering features, not runtime-executable providers.
  • Regex literals rx"..." evaluate to Text values and can be used in expression position. Use the aivi.regex module for runtime pattern matching.
  • Structural patch apply supports single-segment Named Replace and Named Remove on 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.method dynamic runtime-computed reply payloads. Use /guide/source-catalog for the option-level truth table.

AIVI Language Manual