Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Export and callbacks

Platform spec feature

Export and callbacks

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

What this feature specifies

Export and callbacks defines how Beskid code exposes entrypoints to foreign hosts (plugins, embedders, C drivers) and how function-pointer callbacks are registered for re-entry.

This is user interop, not the frozen runtime builtin table on the Rust ABI profile. Export symbols are generated from Beskid compilation units; runtime builtins remain beskid_abi exports.

v0.3 scope

In scopeOut of scope
[Export] on pub functions with FFI-permitted typesExporting arbitrary contract vtables as Standard
Callback registration table protocolForeign-thread entry without host contract (Proposed v0.3.2+)
Trampolines for GC-safe re-entryChanging BESKID_RUNTIME_ABI_VERSION for export-only features

Spec is Standard in v0.3; reference compiler support for export lowering, callback registration, and link-time extern resolution is landed on Linux tier-1 (see verification).

Implementation anchors

  • Export metadata in compiler/crates/beskid_codegen/src/lowering/expressions/export.rs and compiler/crates/beskid_codegen/src/lowering/context.rs (CodegenArtifact::exports)
  • AOT export table and linker export policy: compiler/crates/beskid_aot/src/export_table.rs
  • Callback registration and GC-safe trampolines: compiler/crates/beskid_runtime/src/builtins/callback.rs (beskid_register_callbacks, BESKID_USER_FFI_LAYOUT_BAND in compiler/crates/beskid_abi/src/symbols.rs)
  • Optional extension of interop_dispatch_* for typed host callbacks (reserved; not user Extern)

No open decisions. Closed choices are normative ADRs under adr/ (D-LMETA-EXPORT-0001D-LMETA-EXPORT-0004); use the reader ADRs tab for detail.

Articles