2ed355c6fa
Post-audit downstream-LLM-author field test of the shipped loop/recur surface (DESIGN.md + public examples only). 3 real iterative programs (Newton isqrt, Collatz, Euclidean gcd) + 5 plausible-mistake negatives + 2 no-termination probes, all run through the public ail CLI. 0 bugs. 4 working findings on the milestone's own axes: rejection diagnostics point-exact AND self-fixing; recur tail-position threads through match/let/outer-if (spec only showed if); loop composes as a value sub-expression + byte-stable round-trip; no-termination boundary exact. This empirically substantiates the "LLM author can now write iterative programs" claim. Two orthogonal non-blocking findings, neither in loop/recur scope, both routed to P2 todos (refused the scope creep into a loop/recur tidy): niladic (app f) spec_gap independently re-confirms the existing mut-local-F3 roadmap item (the design-fork decision deliberately NOT auto-ratified under /boss — parked, priority-strengthened); module-level (doc) diagnostic-hint friction (one-line tidy). Boss-verified independently (gcd->27; recur-outside-loop fires exact). The standalone loop/recur milestone is fully ratified and CLOSED: 3 iterations + tidy shipped, audit clean (drift resolved, bench pristine carry-on), fieldtest clean on every axis. Roadmap P0 marked closed.
20 lines
858 B
Plaintext
20 lines
858 B
Plaintext
; NO-TERMINATION BOUNDARY fixture. An LLM-natural shape: a "tick"
|
|
; event loop that never exits (no non-recur branch). Per the
|
|
; loop-recur spec this MUST `ail check` AND `ail build` cleanly —
|
|
; AILang makes no termination claim. BUILD-ONLY: by design this
|
|
; binary never returns, so it is never executed.
|
|
(module loop_recur_5_event_loop_noterm
|
|
(fn run_forever
|
|
(doc "Infinite event loop. Two binders: tick counter and a running parity flag. No branch ever exits via a non-recur term.")
|
|
(type (fn-type (params) (ret (con Int))))
|
|
(params)
|
|
(body
|
|
(loop (tick (con Int) 0) (parity (con Int) 0)
|
|
(if (app == (app % tick 2) 0)
|
|
(recur (app + tick 1) 1)
|
|
(recur (app + tick 1) 0)))))
|
|
(fn main
|
|
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
|
(params)
|
|
(body (app print (app run_forever)))))
|