Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

21. FFI and other forbidden friendships

Interop with C, Rust ABI profiles, extern, and callbacks—when you must talk to the outside world.

FFI and other forbidden friendships

FFI is where languages go to die. Beskid separates language interop law (language-meta) from host dispatch (execution ABI) so you know which spec page to argue about.

Start by choosing the boundary you need, then read the applicable profile before writing declarations or host glue. This chapter provides the route; Interop and ABI and host provide the authoritative contracts.

| Section | Topic | | --- | --- | | Interop overview | Domain map and profiles. | | FFI and extern | extern and contract imports. | | C ABI profile | Link-time and dynamic resolution. | | Rust ABI profile | Boundary stability (not “import any crate”). | | Export and callbacks | Hosting Beskid from native code. |

accTitle: Foreign interface selection
accDescr: Beskid extern declarations select either the user-facing C ABI profile or the runtime-only Rust ABI profile.
flowchart LR
bd[Beskid code] --> extern[extern / import]
extern --> cabi[C ABI profile]
extern --> rabi[Rust ABI profile]
cabi --> native[Native library]
rabi --> shims[Runtime shims]

Text equivalent: Beskid code reaches native libraries through an extern declaration. User code uses the C ABI profile. The Rust ABI profile is limited to language-owned runtime shims.

22. So you want to contribute