Skip to the content.

FFI VS ABI

FFI (Foreign Function Interface) and ABI (Application Binary Interface) are related concepts in programming, but they serve different purposes and operate at different levels of abstraction. Here’s how they differ:

Foreign Function Interface (FFI)

extern "C" {
    fn c_function(arg: i32) -> i32;
}

Here, extern “C” specifies the use of C’s calling convention, enabling Rust to call a function defined in C.

Application Binary Interface (ABI)

Key Differences

Summary

FFI uses the ABI to ensure that cross-language calls work correctly at the binary level, making both concepts essential for language interoperability and system programming.