diff --git a/docs/WhatsNew.md b/docs/WhatsNew.md index d4e0ebe..dd65338 100644 --- a/docs/WhatsNew.md +++ b/docs/WhatsNew.md @@ -180,3 +180,15 @@ All tests green. Benchmark scripts all pass at the (updated for this milestone) ## 2026-05-16 — Experimental iteration redesign fully reverted The experimental iteration redesign is fully reverted. It had added named loops, compiler-checked-terminating recursion, and a non-termination effect — all removed; the language's iteration story is back exactly to plain recursion, nothing new to learn. It was pulled because it had grown from a small documentation gap into a sweeping language-identity change, then hit a wall where it would have made a very natural kind of function impossible to write, and the only escape weakened a core correctness guarantee you co-designed. Backed out cleanly: program behaviour verified byte-identical to the pre-change state, full test suite green, benchmarks clean (one metric flagged as pre-existing machine drift, not caused by this — filed separately). The honest one-paragraph documentation note the original gap actually needed is now in place; the genuine total-recursion ambition is preserved on the roadmap, sequenced behind the type-system work it really needs. Your streaming example was never part of this and is untouched. Its next step is the effect-handler foundation — the heaviest building block, with open design questions I'd rather shape with you than decide solo while you're away. That's the natural place to pick up. + +## 2026-05-18 — Loops are a first-class language construct + +AILang can now express iteration directly: a loop block with named carried values and a re-entry form that jumps back to the top with new values. Until now the only way to repeat work was recursion through helper functions; an author can now write the loop the way they would naturally reach for it. It is complete end to end — it parses, type-checks, compiles to a native binary, and runs. + +The natural mistakes are caught at compile time with exact, self-explaining messages: re-entering with the wrong number of values, the wrong types, using re-entry outside a loop or as if it returned a value, and capturing a loop variable inside a closure. Each message names the function and says how to fix it. + +It was field-tested by writing real programs from scratch against the documentation alone — integer square root by Newton's method, Collatz step counts, Euclidean gcd used as a sub-expression — all worked on the first try, including shapes the documentation did not explicitly show. An endless loop is allowed and compiles cleanly, with no false "this never terminates" complaint. + +Two unrelated, pre-existing minor surface gaps were noticed while testing and written down for later; neither affects loops. + +The milestone is closed and fully verified — built across three steps plus a follow-up safety fix, drift-reviewed, benchmarked clean, and field-tested. The next milestone is a fresh decision; that is the natural place to pick up when you are back.