Duck-Tape Chronicles: Rust C++ Interop

Victor Ciura

⏱ 90 minute session
beginner
intermediate
09:30-11:00, Friday, 4th April 2025
C++/Rust is not a zero-sum game. We need to learn to play nice together... for a looong time! That applies equally to people, but also to code. Rust code everywhere is increasing at an accelerated rate, but so does C++ (and that's on top of gazillion lines already out there). So, hybrid codebases are quickly becoming the norm.
Having seamless interop between the C++ and Rust components is essential for the success of this symbiosis. There are many challenges in this process, but people found various ways to make things "work" - from dealing with ABI compatibility and platform/toolchain guarantees, to going down to C and FFI, to various techniques and tools for generating glue-code between the two languages.
Alas, general-purpose interoperability (not tied to a specific toolchain/IR) without loss of performance has yet to be achieved. Just "making things work" is not enough in the domain space of C++ and Rust; as such, many of the explored solutions so far by the community fail to deliver on all the needed requirements, swinging the wide range between performant and ergonomic.
This presentation aims to highlight all of the interop challenges, some of the explored solutions out there, and tease out the avenues at the forefront of this pursuit.
🏷 C++
🏷 Rust
🏷 idioms
🏷 oxidation
🏷 rewrite
🏷 interop
🏷 windows-rs
🏷 FFI
🏷 ABI
🏷 Windows
🏷 security
🏷 Azure
🏷 cargo
🏷 tooling
🏷 crates
🏷 CI/CD
🏷 static analysis
🏷 unsafe
🏷 API
🏷 cbindgen
🏷 cxx
🏷 crubit
🏷 CMake
🏷 hybrid
🏷 LLVM
🏷 MSVC

Victor Ciura

Victor Ciura is a Principal Engineer on the Rust team in Microsoft DevDiv, building the compiler toolchain and libraries needed for the broader πŸ¦€Oxidizer effort across the organization and Rust open-source community.

Spent the last 20+ years doing systems programming in C++ on various teams, such as: Visual C++ (DevDiv), Advanced Installer, Clang Power Tools.

He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on algorithms and optimization techniques, using modern C++, Rust, Haskell.

More details: https://ciura.ro & linkedin.com/in/victor-ciura