Adopting Rust means talking to Rust..but how?

Slide header

Practical strategies for integrating Rust into existing code bases using cross-language communication. This talk was presented at the Embedded Systems Engineering Kongress in Sindelfingen (DE) in 2025.

Abstract

Over the past decade, Rust has emerged as a powerful and versatile systems programming language for foundational and embedded software development, making it an attractive alternative or complementary tool for many software engineers and companies considering its adoption into existing codebases. However, adoption of a fundamental tool like a programming language comes with great challenges and considerations. An often-heard meme is the suggestion to “just rewrite it in Rust,” which, frankly, rarely makes sense for seriously substantial software projects. In reality, one of the main challenges for successful adoption is to strategically assimilate Rust into an existing code base or software ecosystem. Simply put, adopting Rust often means talking to it from other programming languages. But what are the possibilities here? What does this even look like? Does this mean all interfaces must be lowered to the C language level? Are there any tools to facilitate these interlanguage communication boundaries? And will language adoption always succeed? In this talk, I will answer these questions, and show that there are various ways to interact with Rust using the rich tooling ecosystem around foreign function interfaces (FFIs). We will look at low-level interfaces between languages, helper tools and systems, and work our way up to using WebAssembly to build interfaces between virtually every language and platform. I will show examples of FFI implementations between Rust and C, C++, Python and Kotlin, and the tools used to build these FFIs. Furthermore, we will take a look at build system considerations around including an FFI in your code base, and what some of the trade-offs are for language adoption. Even if adopting Rust specifically is not your goal, you will learn what dealing with language adoption and inter-programming language communication may look like in practice.

Audience

Professionals in software engineering, level novice to expert, interested in Rust, or foreign function interfaces (FFIs) between programming languages.

Talk layout

The talk is split up in the following parts:

  • Why talk to Rust?
  • Building bridges between languages,
  • The lingua franca of low-level FFIs: C,
  • Bridging larger spans: dynamic languages,
  • WebAssembly as the common tongue,
  • Conclusions + ending.

Goals

  • Show why Rust can be an interesting language for strategic adoption.
  • Show what a C-level inter-language FFI looks like and how it’s similar for all languages.
  • Show some of the tooling and libraries available to create FFIs at a higher level of abstraction.
  • Show what some of the pitfalls are of introducing an FFI, and how FFIs fail.
  • Show how creating an FFI is as much about build system orchestration as the FFI implementation itself.
  • Show how WASM/WASI can play a role in the future to facilitate a “uniform FFI” for all languages.
  • Show why careful design around ergonomics and behavior for a FFI are crucial for the success of it.
  • Provide the attendee with a “gut feeling” of the workings and considerations around FFIs to Rust.
  • Point the attendee to the Rust FFI examples code repository for reference.