Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Interop.Contracts — Language-agnostic mapping rules

Platform spec article

Interop.Contracts — Language-agnostic mapping rules

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Beskid surfaces foreign entrypoints through contract declarations annotated for interop (see FFI and extern). At the Interop.Contracts layer, each contract method contributes:

  • A logical symbol derived from the contract’s extern metadata, optional per-method Symbol override, or the method’s foreign name when no override is present.
  • A call shape derived from Beskid parameter and result types using the type-shape rules on the parent hub’s core primitives article.

The compiler must reject declarations that cannot be lowered to any supported profile’s call shape without undefined behavior.

The same abstract call shape may admit more than one profile lowering in the future. Interop.Contracts defines the shared normalization step; C ABI profile and Rust ABI profile document which shapes each profile accepts in the current toolchain.

Calls to runtime builtins (allocation, syscalls, internal dispatch helpers) use the same abstract machinery but are not user-authored Extern contracts. They are governed by the runtime ABI and syscall ownership documents under /execution/runtime/; those surfaces must remain consistent with the symbol tables in beskid_abi.