docs(ffi-linkage): checkpoint — Phase 6.3 (std) done; next Phase 6.4 (ffi)
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.
|
||||
|
||||
## Last completed step
|
||||
**Phase 6.2 — migrate `platform/` `#foreign`→`extern`/`export`** (`refactor` commit
|
||||
**Phase 6.3 — migrate `std/` `#foreign`→`extern`** (`refactor` commit `59f90d2`).
|
||||
Pure source rename across 11 std modules (~60 sites):
|
||||
cli/core/fmt/fs/log/net.kqueue/process/socket/thread/time/trace. All fn-decl markers
|
||||
— bare `#foreign;`, `#foreign libc;`/`#foreign tlib;` (LIB ref), and
|
||||
`#foreign libc "csym";` (LIB+rename) → the same `extern …` tail (`extern` carries the
|
||||
identical `[LIB] ["csym"]` axis); plus 2 stale comment mentions (fmt/fs). No class
|
||||
forms in std. These modules ARE host-corpus-exercised → empty snapshot diff is direct
|
||||
validation. Suite green (647 corpus / 444 unit, 0 failed). Remaining Phase 6 batches:
|
||||
6.4 ffi (~50, has runtime classes), 6.5 remainder.
|
||||
|
||||
### Prior: Phase 6.2 — migrate `platform/` `#foreign`→`extern`/`export` (`refactor` commit
|
||||
`2cd5d7b`). Pure source rename across uikit/android/android_jni/sdl3 (~64 sites):
|
||||
30 fn `… #foreign;`→`… extern;`; 34 import runtime classes
|
||||
`#foreign #objc_class/#jni_class("X") {`→`#…_class("X") extern {` (prefix→postfix);
|
||||
@@ -184,19 +194,19 @@ 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.3 (migrate `library/modules/std/` `#foreign`→`extern`, ~60
|
||||
sites).** Phase 6.1 (sqlite) + 6.2 (platform) COMPLETE.
|
||||
**PART B — Phase 6.4 (migrate `library/modules/ffi/` `#foreign`→`extern`/`export`,
|
||||
~50 sites).** Phase 6.1 (sqlite) + 6.2 (platform) + 6.3 (std) COMPLETE.
|
||||
|
||||
- **Phase 6.3** (`refactor`, snapshot diff must be EMPTY): rewrite
|
||||
`library/modules/std/` (socket/thread/fs/time/process/…) `#foreign`→`extern`. Mostly
|
||||
libc fn decls (bare `#foreign;` or `#foreign "csym";`); check for any data-global
|
||||
`#foreign` too. These ARE exercised by the host corpus (fs/process/socket examples),
|
||||
so a non-empty snapshot diff catches a regression directly — STOP and coalesce, don't
|
||||
regen. Transform: `s/ #foreign;/ extern;/` for bare, plus the `#foreign "csym"`/
|
||||
`#foreign LIB "csym"` rename forms where present (verify per-file first like 6.2).
|
||||
- **Remaining Phase 6 batches:** 6.4 `library/modules/ffi/` (objc/raylib/objc_block,
|
||||
~50 — has runtime classes, use the postfix shape like 6.2), 6.5 remaining `library/`+
|
||||
`vendors/`. Then **Phase 7** migrates examples + issues the same way.
|
||||
- **Phase 6.4** (`refactor`, snapshot diff must be EMPTY): rewrite
|
||||
`library/modules/ffi/` (objc/objc_block/raylib/sdl3/opengl/stb/…) `#foreign`→`extern`.
|
||||
⚠ Like platform (NOT std), `ffi/objc.sx` has Obj-C **runtime classes** — use the
|
||||
postfix shape (`#objc_class("X") extern {` for imports, `… export {` for defined),
|
||||
and check each site's shape per-file before bulk-replacing. Verify corpus coverage
|
||||
per module: raylib/stb/sdl3 examples (15xx/12xx) compile on host → corpus validates;
|
||||
any host-uncompiled module (check importers) needs an `sx ir` probe like 6.2.
|
||||
- **Remaining Phase 6 batches:** 6.5 remaining `library/`+`vendors/` (math/, other
|
||||
vendors, anything still holding `#foreign`). Then **Phase 7** migrates examples +
|
||||
issues the same way.
|
||||
- **6.2 verification note (carry forward):** the `platform/` runtime modules
|
||||
(uikit/android/android_jni) are NOT compiled by any marker'd host corpus test — verify
|
||||
future platform-adjacent migrations via direct `sx ir` on importers (1610/1606 compile
|
||||
@@ -323,6 +333,10 @@ 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.3 std) Migrated 11 `std/` modules (~60 sites): cli/core/fmt/fs/log/net.kqueue/
|
||||
process/socket/thread/time/trace. All fn-decl markers (bare / `libc`|`tlib` LIB ref /
|
||||
`libc "csym"` rename) → `extern …` + 2 comment mentions; no class forms. Host-corpus-
|
||||
exercised → empty snapshot diff validates. Suite green (647/444). `refactor` `59f90d2`.
|
||||
- (6.2 platform) Migrated `platform/` (uikit/android/android_jni/sdl3, ~64 sites):
|
||||
30 fn `#foreign;`→`extern;`, 34 import classes prefix `#foreign #objc/jni_class`→
|
||||
postfix `… extern {`, 4 defined `Sx*` objc classes → `… export {`. Behavior-
|
||||
|
||||
Reference in New Issue
Block a user