This page aims to give a comprehensive overview of the available language interop (= interoperability) options for the Rust programming language.
We want to highlight libraries that enable using:
- Rust as a guest language (e.g. "Rust in Python" for speeding up Python libraries)
- Using other guest languages from Rust(e.g. "Python in Rust" for taking advantage of rich foreign ecosystems)
This page aims to highlight deep integrations between Rust and a specific foreign language. Luckily, even if those do not exist, we can fall back to FFI or other polyglot technologies (e.g. WASM).
Some links for more generalized foreign language integrations:
-Rustonomicon chapter about FFI
-Examples for using FFI with many languages
-bindgen crate to automatically generate Rust FFI bindings to C (and some C++) libraries.
-Rust and Webassembly book
This project is a tool for calling C++ from Rust in a heavily automated, but safe, fashion. Think of autocxx as glue which plugs bindgen into cxx.
rust-cpp is a build tool & macro which enables you to write C++ code inline in your rust code.
Tool for connecting programs or libraries written in Rust with other languages. Currently implemented support for C++ and Java, but you can write support for any language of your choice.
High-level memory-safe binding generator for Flutter/Dart <-> Rust
Rustler is a library for writing Erlang NIFs in safe Rust code. The library provides functionality for both Erlang and Elixir.
Rustler is a library for writing Erlang NIFs in safe Rust code. The library provides functionality for both Erlang and Elixir.
j4rs stands for 'Java for Rust' and allows effortless calls to Java code from Rust and vice-versa.
j4rs stands for 'Java for Rust' and allows effortless calls to Java code from Rust and vice-versa.
This library provides a procedural macro to make easier to write JNI-compatible code in Rust. It can perform automatic conversion of Rust-y input and output types
Tool for connecting programs or libraries written in Rust with other languages. Currently implemented support for C++ and Java, but you can write support for any language of your choice.
Rust bindings for writing safe and fast native Node.js modules. Wraps V8 API at the moment, Node.js N-API support is work in progress.
Easy way to write Node.js module using Rust, wrapping Node.js N-API.
This library is a high level interface between Rust and Lua. Its goal is to be an easy to use, practical, flexible, and safe API between Rust and Lua.
Bindings and abstractions for the PHP API, making it easy to write native, low-level PHP extensions in Rust.
Rust bindings for the python interpreter.
Rust bindings for Python. This includes running and interacting with Python code from a Rust binary, as well as writing native Python modules.
Rust bindings for the python interpreter.
Milksnake is an extension for setuptools that allows you to distribute dynamic linked libraries in Python wheels in the most portable way imaginable.
Rust bindings for Python. This includes running and interacting with Python code from a Rust binary, as well as writing native Python modules.
Template R package with rust bindings
Integrate Ruby with your Rust application. Or integrate Rust with your Ruby application. Continuation of ruru and ruby-sys.
Helix allows you to write Ruby classes in Rust without having to write the glue code yourself.