CLOSED 2026-05-28: superseded by milestone #7 raw-buf. The same primitive (mutable indexed flat buffer of Int/Float/Bool elements) is now scoped under the kernel-extensions architecture. The Embedding-ABI batch-crossing use case that motivated this milestone is folded into #7's description as a second consumer alongside the new series library extension. See design/models/kernel-extensions.md.
(original description preserved below)
Priority: P2 — Medium-term
Performance follow-up to the Embedding ABI arc, not a capability gap.
AILang's only sequence is the recursive List ADT (one RC cell per element). The ABI arc resolved chunk-crossing by having the M5 adapter unroll each data-server chunk host-side into per-tick (State, Tick) -> State calls (M4's cons-list crossing was retired as speculative infra) — so the residual perf question is no longer '1024-cell cons-chain per chunk' but host-per-tick-FFI vs. an eventual batch/flat-array crossing. M5's friction-harvest measured the per-tick FFI at ≈ ~206 ns/tick at real EURUSD volume (≈ 658 ms / 3.19 M ticks).
Open decision: whether a contiguous array/slice primitive (to amortise that per-tick cost via a batch crossing) is worth a language change — it interacts with uniqueness inference, RC, and the structurally-decreasing-recursion totality story, and is out of the (now-closed) ABI arc's scope. Now decidable on the measured number, not speculation.
depends on: Embedding ABI — M5 (shipped; measured ~206 ns/tick — the justification input now exists).
context: 2026-05-18 chat (user deferred this to keep the ABI arc clean); the friction-harvest number recorded in the M5 audit commit; M4 retirement decision recorded in the M5 closing commits.
Priority: P2 — Medium-term
Structural + Int-bounded total recursion with enforced non-negativity.
AILang's iteration story stays as-is (structural / tail recursion; tail-app intact). The genuine ambition — make f(n-1)-family recursion (incl. branching tree builders) total by construction with the non-negative-entry precondition enforced, not merely documented — is deferred here because doing it without a purity-pillar concession requires refinement/Nat type machinery the language has not built (Decision 4 keeps refinements opaque, no SMT). Not abandoned; correctly sequenced after the type machinery.
depends on: a future Nat/refinement-types milestone (no spec yet).
context: docs/specs/0032-iteration-discipline-revert.md (why the 2026-05 attempt was reverted); the branching-builder counter-example that surfaced the gap landed in the it.3 iter commit.
Stateful islands
CLOSED 2026-05-28: superseded by the kernel-extension-mechanics arc (#6 → #7 → #8). This conversation IS the 're-think with the user' the original description said was needed before further sub-milestone work. The re-think went in a different architectural direction:
- Stateful-islands proposed:
!Muteffect,mutblock +var/assignAST nodes (re-introducing whatremove-mut-var-assignatomically removed 2026-05-18),Stateful a bfirst-class sealed callable,pipecombinator, Decision-12 Memory-Model amendment. - Kernel-extensions delivers: no new effect (own/borrow + uniqueness inference covers the mutation discipline), no re-introduced
mut/var/assign, concreteSeriesADT instead of abstractStateful,RawBufas the storage primitive (the conceptual MutArray with a different name), no pipe combinator in MVP (additive later if shown necessary), no memory-model amendment (kernel-extensions is orthogonal).
Same motivating workload class (SMA, rolling indicators, IIR filters, online aggregates), substantially fewer new language mechanisms. Per Feature-acceptance clause 3 (no bug-class reintroduction) and AILang's 'minimize new mechanisms' line, kernel-extensions is strictly preferable.
Original Stateful-Islands reasoning preserved in commit ae96c90 (roadmap) and the issue history; reachable if a future workload reveals a gap kernel-extensions cannot fill.
Architectural anchor: design/models/kernel-extensions.md.
intrinsic-bodies
New Form-A body marker (body (intrinsic)) for compiler-supplied bodies. Eliminates the dummy-body lie in prelude (eq__Int currently ships (body false)) and unblocks the polymorphic kernel-tier fns raw-buf.2 needs (placeholder-impossible problem). See raw-buf.2 BLOCKED analysis for the trigger; design discussion in this chat thread.
CLOSED 2026-06-02: complete. All three iterations shipped — prep.1 namespacing (#31), prep.2 Term::New (#32), prep.3 kernel-tier + param-in (#33), all closed. Spec docs/specs/0052-kernel-extension-mechanics.md; model design/models/0007-kernel-extensions.md. Prose-projection follow-ups (#35) and the loader/diagnostic friction (#34) are tracked as separate unattached issues, not milestone scope.
Language-level mechanisms for kernel-extension plugin types: type-scoped namespacing, new term construct, kernel-tier modules + auto-import, param-in restriction. Implements design/models/0007-kernel-extensions.md. Three iterations: prep.1 namespacing, prep.2 Term::New, prep.3 kernel-tier + param-in. Spec: docs/specs/0052-kernel-extension-mechanics.md
raw-buf
Base extension: mutable, indexed, bounded-size flat buffer of primitive elements (Int, Float, Bool). Implemented as kernel-tier module + Rust codegen intercepts emitting LLVM IR; no new C code. Also triggers migration of try_emit_primitive_instance_body into the plugin intercept registry — one mechanism for all intercepts.
Two consumer use cases motivate this base extension:
-
Storage layer for the
serieslibrary extension (next milestone #8) — Series wraps RawBuf to provide a bounded ring buffer with financial-style indexing for streaming analytics. -
Batch FFI crossing for the Embedding ABI (subsumes the closed #2 'Flat array/slice primitive' milestone). The Embedding-ABI M5 friction-harvest measured per-tick FFI at ~206 ns/tick at real EURUSD volume (~658 ms / 3.19 M ticks). A contiguous array/slice primitive amortises that per-tick cost via a batch crossing — RawBuf is that primitive.
Architectural anchor: design/models/kernel-extensions.md § Two-tier extension architecture. Depends on milestone #6 (kernel-extension-mechanics) for the language-level building blocks.
series
Library extension: Series T — a bounded ring buffer for streaming analytics, financial-style indexing (0 = newest). A kernel-tier .ail module wrapping a RawBuf — pure AILang, no Rust intercepts, no C, no LLVM IR emission. Depends on the shipped raw-buf milestone (#7). Architectural anchor: design/models/0007-kernel-extensions.md § "Series as the first library consumer".
Scope — two steps
- Step 1 — primitive Series over {Int, Float}. Flat type-specialised RawBuf,
ownvalue-returns. The SMA worked example in 0007 §"Worked example" is the clause-1 acceptance fixture. Narrower than RawBuf'sparam-in{Int,Float,Bool}; Bool is free to add later, omitted from step 1 on purpose. - Step 2 — SoA record-of-series. A record-valued Series stored struct-of-arrays. Downstream of step 1; separate brainstorm.
Decisions carried in from the 2026-06-02 design discussion
- D1 — No 0008 return-side tail dependency. No Series operation returns a borrow:
new/pushreturn freshownallocations;at/len/total_countreturnownvalue copies. Borrow-returns are doubly unneeded — over a value typeborrowis a check error (0008 §3.2), and under SoA a materialised record has no contiguous object to borrow. The return-side escape/soundness pass (the "Iteration-totality story" milestone, #3) is therefore NOT a prerequisite. Series uses borrow parameters (already shipped + verified), never borrow returns. - D2 — No 0009 (explicit RC) dependency. Series rides today's universal-RC + uniqueness inference. A future 0009 cutover would migrate Series source nearly unchanged (annotation-only:
(con RawBuf a)→(box RawBuf a)). Series is corpus evidence for a 0009 decision (the single-owner workload 0009 bets on), not downstream of it. - D3 — Step-2 SoA strategy leans record-of-series composition. Bundle N primitive Series in an AILang ADT (e.g.
(ctor PVS (con Series Float) (con Series Int))), rather than 0007's RawBuf-internal record-element intercept. Keeps step 2 pure library-extension (zero Rust) and makes step-1 primitive Series the literal building block. To confirm at step-2 brainstorm; also decides the structural-vs-nominal record question forat's return type. - D4 — Efficiency: layout + read path optimal; two accepted deviations. The flat type-specialised buffer and the indexed-load read path are not improvable. Accepted costs: (a) two allocations (Series wrapper ADT + RawBuf slab) vs one — the price of library-extension over base-extension; (b)
pushin-place is uniqueness-inference-dependent, not by-type guaranteed. - D5 — clang is NOT a safety net for wrapper elision. Empirically verified (clang -O2 over
examples/box.ail): the RC heap allocation survives-O2. The constant flows through the store/load via constant propagation, butailang_rc_alloc/ailang_rc_decremain — opaque allocator (no allocator attributes on thedeclare), and LLVM has no generic refcount-elimination pass (Swift/ObjC-ARC do this with dedicated language passes, not the-O2pipeline). Wrapper elision is the AILang inference's job, pre-IR. Consequence:pushin-place must be measured (bench), not assumed — an explicit step-1 acceptance point.
North star — a capability, not a product.
The AILang ecosystem lets a domain expert build and maintain a working program through a visual dataflow representation alone — without ever reading or writing the code. The human's only authoring act is annotating the representation; an LLM translates the annotations into .ail changes.
The representation is:
- domain-unspecific — it reads only language structure (defs, bodies, applications, lets, matches, effects), never a hardcoded vocabulary; node names come from the module itself;
- adjustable in detail — the function/scope hierarchy is the zoom level: a function is a black box, which the user can open (see its body as a dataflow sub-graph) and enter (make that scope the root, to edit).
Round-trip model — identical to the prose surface. Like ail prose / ail merge-prose (docs/PROSE_ROUNDTRIP.md), the visualization is a second lossy, deterministic forward projection of the canonical .ail.json; re-integration of edits goes through an LLM mediator, never a syntactic back-parser.
This is the roof. It spans several milestones. The four issues under it are the staged capabilities on the way there; each describes what should become possible, not a concrete application. (The "algo-trader who never learned to code" is an illustration of a downstream consumer, never a deliverable here.)
Precondition, not a stage — language reach (mainline). Expressing real domain logic (rich types, effect palettes, library-grade composition) grows through the ordinary language milestones. It is a standing precondition for the roof, not a numbered stage of its own.
Stages (see linked issues):
- dataflow-projection — deterministic body-level dataflow reading of the AST
- black-box-libraries — curated reusable building blocks
- annotation-roundtrip — annotations → .ail via LLM mediator
- interactive-shell — navigable, annotatable UI over the projection
(Stage 2 = language reach, mainline, no issue of its own.)