~/talk

Embedding Rust in C/C++

Talkat RustConf 2018 · on Friday, 2018-08-17· [rust]
slides:none on file

Concrete recipes for embedding Rust inside existing C/C++ code appear: use extern "C" and no_mangle to expose symbols, add crate-type like cdy lib or staticlib, generate headers with the mentioned sea pines gem, and run cargo then your C/C++ linker. Memory uses Box and Box::into_raw so C holds pointers; errors map to Result-like structs or C double-pointer patterns. A C shim can call into Rust and a small C shim plus careful linking makes throwing C++ exceptions from Rust work but depends on compiling with a C++ toolchain.

AI-written summary · about

  1. 0:00Start
  2. 3:20Application Binary Interface
  3. 13:13BUILD SYSTEM SUPPORT
  4. 13:50MEMORY MANAGEMENT
  5. 16:37COMMUNICATING ERRORS
~/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.