Interop.Contracts primitives need a single C profile authority for tier-1 hosts.
C ABI profile
Platform spec feature
C ABI profile
Spec standingStandard
-
C/System V binding rules defer to this hub.
Context
Decision
This feature hub must own normative MUST/SHOULD for C-compatible foreign libraries. Sibling articles add detail without redefining hub MUST tables.
Consequences
Cranelift lowering and foreign library import tooling align to this profile.
Verification anchors
/platform-spec/language-meta/interop/c-abi-profile/
-
dlopen is not Standard conformance for tier-1.
Context
Dynamic resolution complicates reproducible builds and CI conformance.
Decision
v0.3 Standard tier-1 conformance must use link-time library binding (link-time linking).
Consequences
Engine may retain Proposed
extern_dlopenpaths separately from Standard claims.Verification anchors
compiler/crates/beskid_codegen; Foreign library import. -
Dynamic resolution profile is non-Standard.
Context
Some hosts want late binding; tier-1 reference path standardizes link-time.
Decision
Runtime
dlopen/dlsymresolution is demoted to the dynamic resolution profile (Proposed appendix, not Standard).Consequences
Documentation and conformance matrices must not require dlopen for Standard tier-1.
Verification anchors
compiler/crates/beskid_engine/src/engine.rs(extern_dlopen, Proposed). -
Windows user-extern linking not tier-1 Standard in corelib.
Context
WinAPI/stdcall surfaces belong in platform packages with distinct conformance tiers.
Decision
WinAPI / stdcall as a stdlib concern is out of scope for tier-1 Standard conformance; platform packages may document Proposed mappings separately.
Consequences
Platform tier matrix records host-specific tiers.
Verification anchors
/platform-spec/language-meta/interop/c-abi-profile/
-
Delivery bands separate Standard views from Proposed layout structs.
Context
Implementers need a spec-first schedule when codegen trails text.
Decision
Band Content Status v0.3.0 Interop views, link-time import, symbol overrides Standard (spec; impl may trail) v0.3.1 CLayoutprimitive structsProposed Later Nested FFI structs, enum ABI, foreign-thread entry Planned Consequences
Articles tag Proposed vs Standard explicitly; CI strict mode can gate premature Standard claims.
Verification anchors
/platform-spec/language-meta/interop/c-abi-profile/ and child articles.
- C ABI profile — C layout types (v0.3.1) repr(C) records for FFI after interop views ship; nested complex types deferred.
- C ABI profile — Dynamic resolution profile Non-Standard appendix for runtime dlopen/dlsym extern resolution (legacy v0.1 path).
- C ABI profile — Extern contracts and linking Library and symbol metadata, JIT dlopen resolution, and policy gates for user extern contracts.
- C ABI profile — Interop view types (v0.3.0) CStringView, CBuffer, and CArrayView layouts for user Extern boundaries.
- C ABI profile — Link-time linking Normative link-time binding for user Extern libraries (v0.3 Standard).
- C ABI profile — Platform tier matrix Tier-1 Standard hosts vs Proposed platforms; WinAPI out of stdlib scope.
- C ABI profile — Types and call conventions Permitted C ABI representations for Beskid extern contract parameters and returns in the reference compiler.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
What this feature specifies
The C ABI profile is the normative mapping from Interop.Contracts primitives to C-compatible foreign libraries on tier-1 hosts. v0.3 Standard conformance uses link-time binding (link-time linking), interop view types (interop view types), and System V AMD64 for the reference compiler path.
Dynamic resolution (dlopen / dlsym) is a Proposed appendix only (dynamic resolution profile). WinAPI is out of scope for stdlib Standard (platform tier matrix).
Lowering uses Cranelift; foreign libraries need only expose C ABI entrypoints compatible with emitted calls.
v0.3 delivery bands
| Band | Content | Status |
|---|---|---|
| v0.3.0 | Interop views, link-time import, symbol overrides | Standard (spec); impl may trail |
| v0.3.1 | CLayout primitive structs | Proposed |
| Later | Nested FFI structs, enum ABI, foreign-thread entry | Planned after basic FFI |
Implementation anchors
- Extern import metadata:
compiler/crates/beskid_codegen/src/lowering/context.rs(ExternImport) - Collection:
compiler/crates/beskid_codegen/src/lowering/lowerable.rs - Contract calls:
compiler/crates/beskid_codegen/src/lowering/expressions/call_expression.rs - Signature validation:
compiler/crates/beskid_codegen/src/cranelift_host.rs - Legacy dynamic resolution:
compiler/crates/beskid_engine/src/engine.rs(extern_dlopen, Proposed) - Stable view layouts (embedding):
compiler/crates/beskid_abi/src/types.rs
Decisions
Section titled “Decisions”No open decisions. Closed choices are normative ADRs under adr/ (D-LMETA-CABI-0001 … D-LMETA-CABI-0005); use the reader ADRs tab for detail.
Articles
- Feature hub owns normative contractC/System V binding rules defer to this hub.
- C ABI profile — C layout types (v0.3.1)repr(C) records for FFI after interop views ship; nested complex types deferred.
- C ABI profile — Dynamic resolution profileNon-Standard appendix for runtime dlopen/dlsym extern resolution (legacy v0.1 path).
- C ABI profile — Extern contracts and linkingLibrary and symbol metadata, JIT dlopen resolution, and policy gates for user extern contracts.
- C ABI profile — Interop view types (v0.3.0)CStringView, CBuffer, and CArrayView layouts for user Extern boundaries.
- C ABI profile — Link-time linkingNormative link-time binding for user Extern libraries (v0.3 Standard).
- C ABI profile — Platform tier matrixTier-1 Standard hosts vs Proposed platforms; WinAPI out of stdlib scope.
- C ABI profile — Types and call conventionsPermitted C ABI representations for Beskid extern contract parameters and returns in the reference compiler.