Export/callback rules were scattered between runtime and language-meta drafts.
Export and callbacks — Verification and traceability
Platform spec article
Export and callbacks — Verification and traceability
Spec standingStandard
-
Beskid-to-foreign export authority.
Context
Decision
This feature hub must own normative MUST/SHOULD for Beskid export and callback registration (user interop).
Consequences
Distinct from runtime builtin exports on Rust ABI profile.
Verification anchors
/platform-spec/language-meta/interop/export-and-callbacks/
-
Export symbols are generated; builtins stay beskid_abi.
Context
Plugin authors confused generated exports with frozen JIT builtin tables.
Decision
User export symbols are generated from Beskid compilation units. Frozen runtime builtin exports remain on
beskid_abi/ Rust ABI profile — export-only work must not changeBESKID_RUNTIME_ABI_VERSION.Consequences
Codegen plans export metadata beside
ExternImport; trampolines use runtime TLS hooks.Verification anchors
/platform-spec/language-meta/interop/export-and-callbacks/ implementation anchors.
-
Contract vtables as Standard export remain out of scope.
Context
Embedding hosts need a minimal stable export surface before full vtable stories.
Decision
v0.3 Standard must support
[Export]onpubfunctions with FFI-permitted types. Exporting arbitrarycontractvtables as Standard is out of scope for v0.3.Consequences
Callback registration table protocol is Standard; foreign-thread entry without host contract is Proposed v0.3.2+.
Verification anchors
-
Normative text can lead reference compiler export support.
Context
v0.3 is spec-first for interop; codegen for export is still landing.
Decision
This feature is Standard in v0.3 specification. Reference compiler support may trail; verification article records gaps until codegen lands.
Consequences
Contributors implement against ADRs without downgrading spec status to Proposed.
Verification anchors
- Callback registration Host registration table protocol for Beskid exports invoked from foreign code (v0.3).
- Export attribute Normative Export metadata for pub functions exposed to foreign hosts (v0.3).
- Export and callbacks — Verification and traceability Conformance fixtures for Export and callback registration (v0.3).
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Reference compiler status
Section titled “Reference compiler status”| Surface | Status | Primary verification |
|---|---|---|
[Export(Abi:"C", Symbol:"...")] on pub fn | Implemented (codegen + AOT) | compiler/crates/beskid_engine/tests/ffi_v03_link_time.rs::export_plugin_init_visible_to_linker |
Callback registration beskid_register_callbacks + layout band | Implemented (runtime export) | compiler/crates/beskid_engine/tests/ffi_v03_link_time.rs::host_registers_callbacks_with_layout_band |
Link-time Extern via project link / external_libraries | Implemented (AOT linker, Linux tier-1) | compiler/crates/beskid_engine/tests/ffi_v03_link_time.rs::link_time_extern_getpid_matches_platform_spec |
Export on non-pub function | Codegen diagnostic | compiler/crates/beskid_tests/src/interop/export.rs::export_on_non_pub_function_fails_codegen |
Verification anchors
Section titled “Verification anchors”- Engine (Linux tier-1):
compiler/crates/beskid_engine/tests/ffi_v03_link_time.rs— link-timegetpid, shared-library export visibility, callback layout-band gate. - Integration:
compiler/crates/beskid_tests/src/interop/export.rs,compiler/crates/beskid_tests/src/interop/callback.rs. - Codegen export metadata:
compiler/crates/beskid_codegen/src/lowering/expressions/export.rs,compiler/crates/beskid_codegen/src/lowering/context.rs(CodegenArtifact::exports). - AOT export table:
compiler/crates/beskid_aot/src/export_table.rs. - Runtime callback registration:
compiler/crates/beskid_runtime/src/builtins/callback.rs(beskid_register_callbacks). - ABI symbols:
compiler/crates/beskid_abi/src/symbols.rs(SYM_BESKID_REGISTER_CALLBACKS,BESKID_USER_FFI_LAYOUT_BAND),compiler/crates/beskid_abi/src/builtins.rs(BUILTIN_SPECS).
Runtime ABI
Section titled “Runtime ABI”Adding user export symbols must not change RUNTIME_EXPORT_SYMBOLS unless a new runtime-provided registrar is promoted to the Rust ABI profile. beskid_register_callbacks is a runtime export for host registration; user [Export] symbols remain generated from Beskid compilation units.