Language Runtimes · Cluster

FFI and Interop

Calling conventions across language boundaries.

  1. 01 The C Calling Convention as an Interoperability Contract How arguments, return values, and stack alignment are encoded at a call site, and why extern C is a narrower promise than most callers assume. foundational · Feb 14, 2026
  2. 02 Symbol Mangling and Linkage in Cross-Language Calls Why C++ and Rust rename functions before the linker sees them, how name mangling differs between compilers, and what dlsym requires of an exported symbol. foundational · Jan 2, 2026
  3. 03 Struct Passing and Register Classification Across ABIs How a compiler decides whether a struct travels in registers or in memory, what the eightbyte classification rules encode, and where layouts diverge between C and other languages. foundational · Aug 3, 2024
  4. 04 String Encoding and Buffer Ownership at the FFI Boundary Why passing a string across a language boundary requires agreeing on encoding, termination, and allocation, and how the two-call pattern avoids guessing at buffer sizes. intermediate · Feb 14, 2026
  5. 05 Allocator Mismatch and Cross-Runtime Deallocation Why freeing memory across a language boundary corrupts the heap, how separate C runtimes end up with separate heaps, and which API shapes make the allocator identity explicit. intermediate · Jan 30, 2024
  6. 06 Native Callbacks Into Managed Code How a C library invokes a function pointer that lands in a garbage-collected runtime, why the trampoline cannot simply be the managed function, and what keeps the target alive. intermediate · Sep 15, 2022
  7. 07 Unwinding Across an FFI Boundary Why an exception cannot safely propagate through a C frame, how table-based unwinding locates a handler, and what a boundary must do instead of throwing through it. intermediate · Nov 28, 2023
  8. 08 Attaching Foreign Threads to a Managed Runtime What a runtime needs from a thread before managed code can run on it, why a library-spawned worker thread has none of it, and how attach and detach bracket the transition. advanced · Aug 30, 2025
  9. 09 Opaque Handles and Ownership Transfer in C APIs Why handle-based interfaces survive changes that struct-based ones cannot, how borrowing differs from transfer, and what an invalidated handle means to the caller. advanced · Jul 29, 2026
  10. 10 Designing a C ABI That Survives Version Changes Which parts of an interface are frozen by binary compatibility, how struct sizing and symbol versioning let a library grow, and what a versioned entry point must promise. advanced · Jun 1, 2026