Skip to content

s2c: givens per goal by rank, generic externs, spec bodies; s1 tests through s2c in the gate - #26

Merged
vic merged 1 commit into
mainfrom
s2c-givens2
Nov 9, 2026
Merged

vic merged 1 commit into
mainfrom
s2c-givens2

Conversation

@vic

@vic vic commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Same change as #25, rebased on main (#24 was rebase-merged, so #25 conflicted).

Givens: a given's fns are typed under its binder groups. Mono reaches a trait goal (a method call on {} evidence at a ground type). It picks the given as Scala3 does (tests/given_rank.srs): the more specific head wins, and on a draw the given with fewer {} binders wins. It makes the given's fns at that goal, named g__.

Generic externs: one C symbol, a [] binder slot is void*, and a call casts a binder result (emit spec sec 3).

Spec bodies allocate nothing at run time: El.New holds El.Alloc (El.In(region) or El.Comptime). A loop measure (decreases) is I64.

Gate (237 ok, 0 FAIL): s2c1 compiles every tests/*.srs with the s1 libs, then each runs against its .out. 30 of 33 pass. The 3 type-decl tests (type_evidence, typelambda, type_values; TLEVEL, vic-m5r.30) print todo. If one starts to pass, the gate fails, so the list cannot go stale.

Mutant: rank inverted gives given_rank 111 (want 123): killed.

…ocate nothing; s1 tests compiled by s2c in the gate
@vic
vic merged commit 2e7a297 into main Nov 9, 2026
3 checks passed
@vic
vic deleted the s2c-givens2 branch November 17, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant