4 ms·
Making FFI calls to C is pretty easy and writing the FFI interface definitions can be completely automated with tools like bindgen [0]. Making FFI calls to C++
by CDSlice 6y ago
Making FFI calls to C is pretty easy and writing the FFI interface definitions can be completely automated with tools like bindgen [0]. Making FFI calls to C++ is a lot harder to do by hand, although cxx[1] is supposed to make doing so a lot easier as long as you can control the C++ end as well to be able to make it compatible with Rust Strings/Vectors/etc.
[0] https://github.com/rust-lang/rust-bindgen https://github.com/rust-lang/rust-bindgen
[1] https://github.com/dtolnay/cxx https://github.com/dtolnay/cxx