5bb721178f
Post-audit downstream-LLM-author field test of the post-removal Form-A surface. 4 fresh real-world programs written from DESIGN.md + form_a.md + public examples only (no compiler source): running sum-of-squares accumulator (loop/recur → 385), grade cascade (let-threaded if → 4/2/0), Horner polynomial straight-line build-up (let-shadow chain → 73), multi-state bracket scanner threading (rest,depth,ok) by tail recursion → true/false. 0 bugs, 0 friction, 0 spec_gap, 4 working — every task clean and correct on the first try with only let/if/loop/recur; all parse|render|parse byte-identical; zero mut/var/assign tokens produced (a doc-faithful author did not reach for the removed construct). The closest-to-friction case (multi-state machine restates the full state tuple per tail-call) is correctly classified working, not a spec_gap: that explicit-dataflow cost is the local-reasoning pillar working as designed; mut's implicit cross-iteration persistence is exactly the failure class the removal eliminates. mut-keyword rejection is fail-closed with a diagnostic that enumerates the surviving forms (no tombstone, no-nostalgia, as spec'd). Removal thesis empirically CONFIRMED — mut was redundant with let/if/loop/recur in 100% of the fresh tasks. The remove-mut-var-assign milestone is fully ratified and CLOSED: spec+plan+iter, audit clean (architect [high] form_a.md fixed in .tidy, bench causally exonerated), fieldtest clean. Roadmap P0 flipped [~]→[x]; WhatsNew user-facing entry appended.
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
; Axis: multi-step straight-line numeric build-up (Horner-form
|
|
; polynomial evaluation over fixed coefficients).
|
|
;
|
|
; Evaluate p(x) = 2x^4 + 3x^3 + 0x^2 + 5x + 7 at x.
|
|
; Imperative instinct (the shape `mut` would invite):
|
|
; acc = 2
|
|
; acc = acc*x + 3
|
|
; acc = acc*x + 0
|
|
; acc = acc*x + 5
|
|
; acc = acc*x + 7
|
|
; return acc
|
|
;
|
|
; Surviving-surface shape: a straight chain of `let acc` shadowings,
|
|
; each step a pure expression. p(2) = 2*16+3*8+0+5*2+7 = 32+24+10+7
|
|
; = 73. Expected stdout: 73
|
|
|
|
(module remove-mut_3_horner_poly
|
|
|
|
(fn poly
|
|
(doc "Horner-form evaluation of 2x^4+3x^3+0x^2+5x+7 as a straight-line let chain (the faithful let/if form of a mutable acc).")
|
|
(type (fn-type (params (con Int)) (ret (con Int))))
|
|
(params x)
|
|
(body
|
|
(let acc 2
|
|
(let acc (app + (app * acc x) 3)
|
|
(let acc (app + (app * acc x) 0)
|
|
(let acc (app + (app * acc x) 5)
|
|
(let acc (app + (app * acc x) 7)
|
|
acc)))))))
|
|
|
|
(fn main
|
|
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
|
(params)
|
|
(body
|
|
(app print (app poly 2)))))
|