3 ms·
That’s about what I expected; thanks. Just for reference for people reading this: rust-bindgen can produce bindings to C++ code these days, though that gets yo
by chrismorgan 9y ago
That’s about what I expected; thanks.
Just for reference for people reading this: rust-bindgen can produce bindings to C++ code these days, though that gets you an unsafe library; you’d want to build another thin layer on top of it to nail down the ownership semantics so that you can provide a safe interface.
- comex 9y agobindgen’s C++ support is better than it used to be, but still pretty limited, e.g. no support for inline functions, or their moral equivalent, methods defined within a class definition (which most C++ code has a ton of). And even if it works, to quote the documentation: > using [C++] types in Rust will be nowhere near as nice as using them in C++. You will have to manually call constructors, destructors, overloaded operators, etc yourself. source: https://github.com/rust-lang-nursery/rust-bindgen/blob/master/book/src/cpp.md https://github.com/rust-lang-nursery/rust-bindgen/blob/maste...
- tmccrmck 9y agoThanks. Sometimes I feel like the "just use X" folks don't really think about the problem at hand, not to mention how trivializing it can be. And this is coming from a Rust fan and someone who uses bindgen.