diff --git a/current/CHECKPOINT-EXTERN-EXPORT.md b/current/CHECKPOINT-EXTERN-EXPORT.md index 80af144..40a384f 100644 --- a/current/CHECKPOINT-EXTERN-EXPORT.md +++ b/current/CHECKPOINT-EXTERN-EXPORT.md @@ -5,7 +5,17 @@ Companion to `current/PLAN-EXTERN-EXPORT.md` — one merged plan: **Part A** add every commit, one step at a time per the cadence rule. ## Last completed step -**Phase 5.1 — annotate A→B gate post-flip + add fn-rename case** (`test` commit +**Phase 6.1 — migrate `vendors/sqlite` `#foreign`→`extern`** (`refactor` commit +`410a52e`). **PART B PHASE 6 STARTED.** Pure source rename: all 97 +`sqlite3_* … #foreign sqlib "csym";` fn decls → `extern sqlib "csym";` (+ the one +stale header-comment reference, line 9). The `extern_lib` axis references the `sqlib` +`#import c` unit identically to `#foreign sqlib`, so IR/output is byte-identical — +empty snapshot diff (only `sqlite.sx` changed), and example 1624 +(`vendor-sqlite-module`) stdout byte-unchanged. Suite green (647 corpus / 444 unit, +0 failed). Remaining Phase 6 batches: 6.2 platform (~95), 6.3 std (~60), 6.4 ffi +(~50), 6.5 remainder. + +### Prior: Phase 5.1 — annotate A→B gate post-flip + add fn-rename case (`test` commit `93e7b6f`). **PHASE 5 COMPLETE → PART B Phase 5 done.** The A→B gate (`lower.test.zig`) already asserted `#foreign` ≡ `extern`/`export` byte-identical IR for fn / global / Obj-C class; post-Phase-5.0 the fn-decl + data-global paths build @@ -160,19 +170,23 @@ AOT), 1227 (export fn rename, AOT), 1348 (objc extern class), 1349 (objc export (jni extern class), 1174/1175 (interplay diagnostics). ## Next step -**PART B — Phase 6 (migrate stdlib `#foreign`→`extern`, empty snapshot diff per -batch).** Phase 5 (parser routing 5.0 + gate lock 5.1) is COMPLETE. +**PART B — Phase 6.2 (migrate `library/modules/platform/` `#foreign`→`extern`, +~95 sites).** Phase 6.1 (sqlite) is COMPLETE. -- **Phase 6** (`refactor` batches, one commit per batch, snapshot diff must be EMPTY): - rewrite `library/` `#foreign`→`extern` (fns/globals), `#foreign #objc_class`→ - `#objc_class … extern`, defined classes → `… export`. Pure SOURCE rename — the AST is - already unified, so IR/output must be byte-identical per batch. A non-empty diff ⇒ a - reader still branches on `foreign_expr` structurally → STOP and coalesce it first - (don't regen). Batches (from PLAN-EXTERN-EXPORT Phase 6): 6.1 `library/vendors/sqlite/` - (~98 sites), 6.2 `library/modules/platform/` (uikit/android/android_jni/sdl3, ~95), - 6.3 `library/modules/std/` (socket/thread/fs/time/process, ~60), 6.4 - `library/modules/ffi/` (objc/raylib/objc_block, ~50), 6.5 remaining `library/`+ - `vendors/`. Then **Phase 7** migrates examples + issues the same way. +- **Phase 6.2** (`refactor`, snapshot diff must be EMPTY): rewrite + `library/modules/platform/` (uikit/android/android_jni/sdl3) `#foreign`→`extern` + (fns/globals), `#foreign #objc_class`→`#objc_class … extern`, defined classes → + `… export`. ⚠ Unlike sqlite (uniform fn decls), platform mixes Obj-C/JNI runtime + CLASSES — those use the **postfix** form (`#objc_class("X") extern { … }` for a + reference/import class == `#foreign #objc_class`; `… export` for a defined class == + bare `#objc_class`). Check each `#foreign` site's shape before bulk-replacing; a + naive `s/#foreign //` is WRONG for the class-prefix form. Pure SOURCE rename, IR + byte-identical; a non-empty diff ⇒ a reader still branches on `foreign_expr` + structurally → STOP and coalesce first (don't regen). +- **Remaining Phase 6 batches:** 6.3 `library/modules/std/` + (socket/thread/fs/time/process, ~60), 6.4 `library/modules/ffi/` + (objc/raylib/objc_block, ~50), 6.5 remaining `library/`+`vendors/`. Then **Phase 7** + migrates examples + issues the same way. - **Phases 6–7** (`refactor` batches, empty snapshot diff per batch): migrate the stdlib + examples from `#foreign` spelling to `extern`. Because the AST is already unified, this is a pure SOURCE rename (`… #foreign LIB "sym";` → `… extern LIB "sym";` @@ -295,6 +309,11 @@ Part A ratified (bare / postfix / `⇒ callconv(.c)` / lib-separate). Part B: deleted at cutover). Affects only diagnostic wording — IR/behavior identical either way. ## Log +- (6.1 sqlite) **PHASE 6 STARTED.** Migrated `vendors/sqlite/sqlite.sx`: 97 + `… #foreign sqlib "csym";` fn decls → `extern sqlib "csym";` (+ line-9 comment). + `extern_lib` references the `sqlib` `#import c` unit like `#foreign sqlib`; IR + byte-identical, empty snapshot diff, example 1624 stdout unchanged. Suite green + (647/444). `refactor` `410a52e`. - (5.1 gate annotate) **PHASE 5 COMPLETE.** Annotated the A→B gate header (`lower.test.zig`) to record that post-Phase-5.0 the fn/global `#foreign` paths build the same extern-named AST → cases 1/2 are structurally (not coincidentally)