iter 23.5: prelude free fns + E2E — Eq/Ord milestone close
Five polymorphic prelude free fns (ne/lt/le/gt/ge) plus three E2E fixtures: positive composition over Int/Bool/Str, user-ADT with user-written Eq/Ord on IntBox, and Float-NoInstance with a Float-aware diagnostic addendum cross-referencing DESIGN.md §"Float semantics". Two checker-side fixes were needed alongside the prelude additions, both symmetric to the iter 23.4-prep visibility fix: - linearity::check_module_with_visible — workspace-aware callee-mode resolution so a Borrow-mode user fn forwarding into a prelude poly fn (e.g. `at_most x y = not (gt x y)`) doesn't false-fire consume-while-borrowed. - mono::collect_mono_targets — distinguish rigid forall vars from unbound metavars; rigid-bearing free-fn targets skip (they get re-collected with concrete subst when the enclosing fn itself monomorphises). Without this, a polymorphic body calling another polymorphic free fn produced a spurious __Unit specialisation whose body referenced compare at Unit. Roadmap split: shipped Eq/Ord half checked, Show + print-rewire half remains pending behind the heap-Str ABI prerequisite. DESIGN.md §"Prelude classes" amended. One pre-existing fixture (test_22b1_missing_method) renamed its class method ne → tne to avoid collision with the new prelude `ne`. Bench: check.py + cross_lang.py exit 0; compile_check.py exits 1 with one sub-ms check_ms.local_rec_capture at +26% (tolerance 25%) — prelude-growth-related noise-band fluctuation, ratifiable per spec §248-249 and journal Concerns.
This commit is contained in:
+18
-22
@@ -41,27 +41,23 @@ context. Pick the next milestone from P1.)_
|
||||
|
||||
## P1 — Next
|
||||
|
||||
- [ ] **\[milestone\]** Post-22 Prelude — ship `Show` / `Eq` / `Ord`
|
||||
with the three total-orderable primitive instances (Int, Bool, Str);
|
||||
rewire `print` through `Show.show`. Float gets `Show` but **not**
|
||||
`Eq` / `Ord` (partial — see Floats milestone). Originally queued
|
||||
as 22b.4 in the typeclass milestone, kept on hold pending demand.
|
||||
- context: JOURNAL 2026-05-09 ("JOURNAL queue"). Floats milestone
|
||||
closed 2026-05-10 — partial-Eq/Ord-for-Float story is documented
|
||||
in DESIGN.md §"Float semantics", so the Prelude can decide
|
||||
what's instanced (Show: yes, Eq/Ord: no for Float).
|
||||
- context: Iter 23.1-23.3 shipped Ordering ADT, Eq / Ord classes,
|
||||
primitive instances on Int / Bool / Str, and runtime helpers
|
||||
(`ail_str_eq` / `compare`). Remaining: polymorphic free fns
|
||||
(`ne` / `lt` / `le` / `gt` / `ge`), `Show` class, `print`
|
||||
rewire. The original Spec-23 draft was retired 2026-05-11
|
||||
because it silently assumed polymorphic free fns are
|
||||
mono-specialised the same way as class methods; that assumption
|
||||
is false today. Re-brainstorm pending — `ailang-grounding-check`
|
||||
(gc.1) will be the gating mechanism on the new draft.
|
||||
- depends on: polymorphic-free-fn mono-specialisation (symmetric
|
||||
to class-method monomorphisation in 22b.3) — not currently
|
||||
ratified by any green test.
|
||||
- [x] **\[milestone\]** Post-22 Prelude — Eq/Ord — shipped milestone
|
||||
23 (2026-05-12). `Ordering` ADT, `Eq`/`Ord` classes, primitive
|
||||
instances on Int / Bool / Str, polymorphic free fns
|
||||
`ne`/`lt`/`le`/`gt`/`ge`, runtime `ail_str_eq` + `ail_str_compare`,
|
||||
end-to-end coverage including user-ADT-instance integration. Float
|
||||
has neither instance by design; polymorphic helpers at Float fire
|
||||
Float-aware `NoInstance` per DESIGN.md §"Float semantics".
|
||||
|
||||
- [ ] **\[milestone\]** Post-22 Prelude — Show + print rewire — ship
|
||||
`Show` typeclass with `Show Int/Bool/Str/Float` instances; rewire
|
||||
`print` through `Show.show`. Gated on heap-`Str` ABI runtime work
|
||||
(`int_to_str` needs to allocate). Originally queued as 22b.4 in
|
||||
the typeclass milestone, kept on hold pending demand and the
|
||||
heap-`Str` prerequisite.
|
||||
- context: brainstorm 2026-05-12 (iter 23.5 wrap). Heap-`Str` ABI
|
||||
is the load-bearing prerequisite; until it ships, `Show Int`
|
||||
cannot allocate a `Str` to return.
|
||||
|
||||
## P2 — Medium-term
|
||||
|
||||
@@ -70,7 +66,7 @@ context. Pick the next milestone from P1.)_
|
||||
primitive comparators. No commitment; gated on bench re-baselining
|
||||
to make sure the indirection doesn't tank latency.
|
||||
- context: JOURNAL 2026-05-09
|
||||
- depends on: Post-22 Prelude
|
||||
- depends on: Post-22 Prelude — Eq/Ord (shipped 23.5)
|
||||
- [ ] **\[todo\]** `types` / `ctor_index` overlay shape question —
|
||||
decide whether the env's two parallel ctor maps should collapse
|
||||
into one overlay, or stay split. Surfaced during the
|
||||
|
||||
Reference in New Issue
Block a user