3 ms·
There are tools to automatically generate "safe" C++-Rust bindings (the intent being to restrict unsafety to trusting C++ code to be sound, without the risk of
by nyanpasu64 6y ago
There are tools to automatically generate "safe" C++-Rust bindings (the intent being to restrict unsafety to trusting C++ code to be sound, without the risk of screwing up the bindings): https://github.com/dtolnay/cxx https://github.com/dtolnay/cxx and https://cxx.rs/ https://cxx.rs/.
However, creating bindings without typing out `unsafe` was a controversial issue, discussed at https://www.reddit.com/r/rust/comments/ielvxu/the_cxx_debate/ https://www.reddit.com/r/rust/comments/ielvxu/the_cxx_debate... .
Also there are tools to automatically parse C++ headers and turn them into cxx bindings: https://github.com/google/autocxx https://github.com/google/autocxx and https://docs.rs/autocxx/ https://docs.rs/autocxx/
- iudqnolq 6y agoWhen you use that sort of thing you pretty much always need to handwrite some bits as well.