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.
What you will find here
Section titled “What you will find here”| 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. |
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]