Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Interoperability

Rust has excellent support for interoperability with other languages. This means that you can:

  • Call Rust functions from other languages.
  • Call functions written in other languages from Rust.

When you call functions in a foreign language, you’re using a foreign function interface, also known as FFI.

  • This is a key ability of Rust: compiled code becomes indistinguishable from compiled C or C++ code.

  • Technically, we say that Rust can be compiled to the same ABI (application binary interface) as C code.