Divya

LLM meets FFI: Rust Bindings for C++ at Scale 🦀

Submitted Mar 9, 2026

Integrating Rust into large C++ codebases often requires safe, idiomatic wrappers. This talk explores using LLMs to draft C++ shim layers and Rust FFI bindings. It highlights where AI accelerates boilerplate, where it fails on ownership and safety, and how to review generated bindings to avoid unsoundness and undefined behaviour.

This talk demonstrates a small end-to-end example of generating Rust bindings for a C++ API using an LLM. It contrasts AI’s strengths in boilerplate generation with its weaknesses in safety-critical details, and offers quick review heuristics for detecting unsound bindings.

  • Attendees will learn a simple “FFI-first” checklist for turning a complex C++ API into a safe Rust wrapper (ownership, errors, threading, lifetimes).

  • Attendees will see a practical prompting pattern to generate draft C++ shims + Rust extern “C” wrappers, including what information the LLM must be given.

  • Attendees will learn how to review AI-generated bindings safely, spotting common failure modes (unsound lifetimes, UB risks, invalid Send/Sync, wrong ownership).

Audience familiar with Rust would enjoy this session.

I am a software engineer at Google’s Core Dev Rust team, focused on developing safe wrappers, C++/Rust interoperability, and scaling Rust in production.

I have designed and shipped safe, idiomatic Rust wrappers for multiple high-usage C++ libraries. This work involves API design, ownership and lifetime modelling, and defining safe abstraction boundaries to keep the unsafe surface area minimal while maintaining performance and long-term maintainability.

Comments

Hosted by

A community of Rust language contributors and end-users from Bangalore. We have presence on the following telegram channels https://t.me/RustIndia https://t.me/fpncr LinkedIn: https://www.linkedin.com/company/rust-india/ more