docs(ffi-linkage): checkpoint — Phase 6.1 (sqlite) done; next Phase 6.2 (platform)
This commit is contained in:
@@ -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.
|
every commit, one step at a time per the cadence rule.
|
||||||
|
|
||||||
## Last completed step
|
## 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
|
`93e7b6f`). **PHASE 5 COMPLETE → PART B Phase 5 done.** The A→B gate
|
||||||
(`lower.test.zig`) already asserted `#foreign` ≡ `extern`/`export` byte-identical IR
|
(`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
|
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).
|
(jni extern class), 1174/1175 (interplay diagnostics).
|
||||||
|
|
||||||
## Next step
|
## Next step
|
||||||
**PART B — Phase 6 (migrate stdlib `#foreign`→`extern`, empty snapshot diff per
|
**PART B — Phase 6.2 (migrate `library/modules/platform/` `#foreign`→`extern`,
|
||||||
batch).** Phase 5 (parser routing 5.0 + gate lock 5.1) is COMPLETE.
|
~95 sites).** Phase 6.1 (sqlite) is COMPLETE.
|
||||||
|
|
||||||
- **Phase 6** (`refactor` batches, one commit per batch, snapshot diff must be EMPTY):
|
- **Phase 6.2** (`refactor`, snapshot diff must be EMPTY): rewrite
|
||||||
rewrite `library/` `#foreign`→`extern` (fns/globals), `#foreign #objc_class`→
|
`library/modules/platform/` (uikit/android/android_jni/sdl3) `#foreign`→`extern`
|
||||||
`#objc_class … extern`, defined classes → `… export`. Pure SOURCE rename — the AST is
|
(fns/globals), `#foreign #objc_class`→`#objc_class … extern`, defined classes →
|
||||||
already unified, so IR/output must be byte-identical per batch. A non-empty diff ⇒ a
|
`… export`. ⚠ Unlike sqlite (uniform fn decls), platform mixes Obj-C/JNI runtime
|
||||||
reader still branches on `foreign_expr` structurally → STOP and coalesce it first
|
CLASSES — those use the **postfix** form (`#objc_class("X") extern { … }` for a
|
||||||
(don't regen). Batches (from PLAN-EXTERN-EXPORT Phase 6): 6.1 `library/vendors/sqlite/`
|
reference/import class == `#foreign #objc_class`; `… export` for a defined class ==
|
||||||
(~98 sites), 6.2 `library/modules/platform/` (uikit/android/android_jni/sdl3, ~95),
|
bare `#objc_class`). Check each `#foreign` site's shape before bulk-replacing; a
|
||||||
6.3 `library/modules/std/` (socket/thread/fs/time/process, ~60), 6.4
|
naive `s/#foreign //` is WRONG for the class-prefix form. Pure SOURCE rename, IR
|
||||||
`library/modules/ffi/` (objc/raylib/objc_block, ~50), 6.5 remaining `library/`+
|
byte-identical; a non-empty diff ⇒ a reader still branches on `foreign_expr`
|
||||||
`vendors/`. Then **Phase 7** migrates examples + issues the same way.
|
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
|
- **Phases 6–7** (`refactor` batches, empty snapshot diff per batch): migrate the
|
||||||
stdlib + examples from `#foreign` spelling to `extern`. Because the AST is already
|
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";`
|
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.
|
deleted at cutover). Affects only diagnostic wording — IR/behavior identical either way.
|
||||||
|
|
||||||
## Log
|
## 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
|
- (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
|
(`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)
|
build the same extern-named AST → cases 1/2 are structurally (not coincidentally)
|
||||||
|
|||||||
Reference in New Issue
Block a user