3 ms·
"they can easily add Rust libraries to existing C++ codebases." Is that truly easy? I would expect all kinds of incompatibilities that would require going thro
by Someone 10y ago
"they can easily add Rust libraries to existing C++ codebases."
Is that truly easy? I would expect all kinds of incompatibilities that would require going through a C layer (object layout, difference in virtual method calling, object ownership, etc). For example, calling a C++ function that takes a pair of iterators from Rust and returns a std::map, passing iterators pointing into a Rust hash table, is that easily done?
- bluejekyll 10y agoWell, it depends on the strategy you use, but yes, you're right that it's hard to share strict/objects. But if the API boundary between the two is kept simple and small, then it's simple. Take a look at the rust ffi omnibus that I posted in this thread. It's object examples show some decent strategies.