Rust interop guide
Talking to Rust from other languages (and vice versa)
What does it actually take to make new Rust code talk directly to your existing software?
This series of blog posts can help you to introduce Rust into your codebase step by step, whether it's C, C++, Python, Node.js, Java, or JavaScript.



Mix in Rust with Java (or Kotlin!)
Java is one of the most commonly used programming languages that we have not yet discussed in our Rust Interop Guide. In this article, we will discuss three different methods to call Rust code from Java: JNI, JNR-FFI and Project Panama. We will show the differences between these methods and we will do some basic benchmarking to compare their performance. These methods not only work for Java but also for other JVM languages like Kotlin. Here we will mainly focus on Java, but Kotlin examples are available in the Kotlin branch of our GitHub repository.
Rust interop in practice: speaking Python and Javascript
Mix in Rust with C++
This article will help you to slowly introduce some Rust into your C++ project. We'll familiarize ourselves with the tooling and go through some examples.
Mix in Rust with Python: PyO3
In this article, we'll dive into combining Rust with Python. Specifically, this post covers calling modules written in Rust from Python scripts.
Mix in C with Rust: A taste of C in your Rust
Can't wait to learn how to call C code from your Rust project after reading my previous posts about Rust interop in general and calling Rust from C? Good! If you haven't read those yet, please do, because I'm going to assume you have in this article. We've seen the basics of Rust's FFI, and have experimented with calling Rust from C. Going the other way around, you'll walk into much the same challenges.
The other day I came across Diplomat, an opinionated tool that makes a lot of choices for you. If you've read my previous post in this series, you'll have seen that that can be quite valuable. If you haven't read the previous article yet, do so before continuing to read this one, as it'll help you appreciate the concepts in this post, and it introduces the example as well.
Mix in Rust with C
So, you've just read my previous post on Rust interoperability in general, and now you're curious about how to actually apply the concepts to your situation. You've come to the right place, because in this post and the two that follow, I'll demonstrate how to make Rust and C talk to each other.
Mix in Rust
What does it actually mean to introduce Rust in an existing project, and having it communicate with other languages in the code base? This article launches a series of blog posts that provide guidance for introducing Rust into your code base step by step.
Meet the contributors
Get professional assistance!
Our engineers are Rust experts and have ample experience designing and building software for systems, web, and embedded platforms.
They can train your team, lead your team, work as part of your team (team augmentation) or take entire projects off your hands.
Check out our training and engineering services to find out how we can help you introduce Rust in your existing projects. Or get in touch with any questions.
Contact us