Building Bridges: Patterns for Rust/C++ Interop
Successfully introducing Rust into existing C++ organizations requires thoughtful interoperability strategies. Drawing from a decade of C++ experience and two years building production Rust systems, I'll share three practical patterns for Rust/C++ interop that serve different architectural needs.
Using concrete examples from robotics, where performance and safety are paramount, we'll explore manual FFI for zero-overhead integration, cxx for safe bidirectional bindings, and message passing for loosely coupled systems. Each approach has distinct trade-offs in terms of performance, safety, and maintainability that I'll demonstrate through a complete working example featuring robot kinematics calculations bridged between Rust and C++.
You'll learn how to structure hybrid Rust/C++ projects, handle error boundaries elegantly, integrate with existing CMake build systems, and choose the right interop pattern for your use case. The talk includes practical tips for introducing these patterns to C++ teams and making the technical case for gradual Rust adoption. Whether you're bringing Rust to a C++ codebase or building new Rust services alongside legacy systems, you'll leave with proven patterns and tools refined through real-world production use.