~/talk

Generating ergonomic C++ APIs using Rustdoc, procedural macros, and Serde

Talkat EuroRust 2024 · 2024-10-10..10-11· [rust]
slides:none on file

Claim: generate ergonomic C++ APIs from an existing Rust API by producing low‑level extern "C" functions that pass byte buffers and then auto‑produce high‑level C++ bindings. Tools actually used are procedural macros, rustdoc’s unstable JSON format, and Serde + bincode to (de)serialize arguments; generated C++ types and per‑impl files mirror Rust types. Measured serialization roundtrip is about 105 ns versus ~40–45 ns baseline, and the system runs in production for months; rustdoc JSON requires nightly.

AI-written summary · about

  1. 0:00Introduction
  2. 1:25FFI matters for Rust
  3. 3:11Past C++ interop challenges
  4. 9:28Goals for new FFI
  5. 11:14Procedural macros for C API
  6. 15:28Parsing Rust with rustdoc
  7. 18:43Generating C++ types/functions
  8. 21:56Async functions in API
  9. 24:27Serialization performance
  10. 25:32Benefits and trade-offs
  11. 26:56Status and future plans
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.