Re:My Vision of D’s Future
by marcosdumay on Tuesday October 15, 2019 @11:18AM
(#21259342)
Most languages settle down with C interop and don't bother with the added complexity from C++. Rust is one of those, some of the concepts aren't even on the language right now, what would lead to very non-idiomatic imports.
[ Parent
| on HN ]
The Rust bindgen tool automatically generates Rust FFI bindings to C and C++ libraries. Mozilla uses bindgen a lot to interoperate between Firefox's C++ and Rust code. IIUC, Rust and C++ code can't seamlessly call each other unchanged, but bindgen adds FFI glue that makes it much easier.
Re:My Vision of D’s Future
by marcosdumay on Tuesday October 15, 2019 @05:36PM
(#21264119)
The C++ on the documentation is there for the few places where there's nothing on the interface not supported by Rust. Notice it says it generates biding for "C (and some C++) libraries".
A C interface on C++ code is how most people do interoperability with C++ libraries. It is pretty much C, so you can just use the FFI. But it's not really a C++ compatible FFI.