Feature: Interop
Mixing Java, Kotlin and Scala in one build: the bytecode contract, the guarantees that vanish across the boundary, and how to choose.
Mixing Java, Kotlin and Scala in one build: the bytecode contract, the guarantees that vanish across the boundary, and how to choose.
The five unsafe abilities, the invariants they transfer to the developer, and the ABI contract at a foreign function boundary.
C++ 与外部世界的边界以 C ABI 为稳定层,pybind11、JNI 与 N-API 各自负责类型、所有权与异常的翻译,跨边界的字符串、容器与回调生命周期决定集成是否可靠。
C ABI 是各语言共同的最低边界:C++ 的 C 链接声明、cgo、ctypes/cffi、JNI、N-API 与 dlopen 各自把同一份调用约定翻译成本语言的对象,本页给出结构布局、所有权、错误映射与回调生命周期的判据。