refactor(ffi-linkage): Phase 9.3/9.4 — purge 'foreign' from issues/*.md; GATE PASS

Rewrote 20 issue writeups to the extern/runtime-class vocabulary (#foreign→extern,
foreign_class_map→runtime_class_map, parseForeignClassDecl→parseRuntimeClassDecl,
findForeignMethodInChain→findRuntimeMethodInChain, dedupeForeignSymbol→
dedupeExternSymbol, is_foreign_c_api→is_extern_c_api, stale filename refs to the
renamed examples, foreign-class→runtime-class, bare foreign→extern). Renamed
issues/0043-…-foreign-class-…→…-runtime-class-….

PHASE 9 COMPLETE — 9.4 GATE PASSES: zero 'foreign' across src/library/examples/
issues/docs/editors/specs/readme/CLAUDE, excluding only the SQLite API constant
SQLITE_CONSTRAINT_FOREIGNKEY + vendored sqlite3.c/.h (upstream third-party).
Suite green (644 corpus / 443 unit, 0 failed).
This commit is contained in:
agra
2026-06-15 11:18:35 +03:00
parent b52d424369
commit b9cfe2554f
20 changed files with 77 additions and 77 deletions

View File

@@ -23,9 +23,9 @@
A `#library` declaration in a module that is reached through TWO (or
more) levels of aliased `#import` never makes it into the build's
library list: `sx build` emits no `-l<name>` on the link line (link
fails with `Undefined symbols` for every `#foreign` fn of that
fails with `Undefined symbols` for every `extern` fn of that
library), and `sx run` skips the dlopen of that library (the JIT then
resolves the foreign symbols only if some already-loaded image happens
resolves the extern symbol only if some already-loaded image happens
to export them).
- Observed: `main → b :: #import "b.sx" → c :: #import "c.sx"` where
@@ -44,11 +44,11 @@ to export them).
Three files in one directory; build `a.sx`.
```sx
// c.sx — declares the library + a foreign fn
// c.sx — declares the library + a extern fn
#import "modules/std.sx";
zlib :: #library "z";
zlibVersion :: () -> ?cstring #foreign zlib "zlibVersion";
zlibVersion :: () -> ?cstring extern zlib "zlibVersion";
zver :: () -> string {
p := zlibVersion();
@@ -91,7 +91,7 @@ Found in the distribution repo the first time a product chain nested
the SQLite bindings two aliases deep: `dist.sx → ops :: #import
"release/ops.sx" → db :: #import "../repo/db.sx" → #import
"../db/sqlite.sx"` loses `-lsqlite3` even though the bindings compile
fine (the foreign wrappers ARE in main.o; only the link flag is gone).
fine (the extern wrappers ARE in main.o; only the link flag is gone).
## Investigation prompt