I tend to think that the ROI for large legacy codebases is in static analysis and instrumented tooling like the sanitizers.
I’m grudgingly coming around to the idea that Rust is probably a rock-solid FFI story away from being a serious part of my kit (pybind11 good, not like anything we have now).
But there is this in-between place where first-class linear/affine typing could be bootstrapped off of move semantics.
FWIW the Rust-C FFI is very solid. Binding to more complex languages is in various degrees of progress. For C++ I have heard really good things about https://cxx.rs/ (but never had the need to try it). wasm_bindgen is already very good for binding to JS and I have heard people having lots of success writing Python and Ruby libraries in Rust (with some manual glue on the scripted side).
I agree that the language-level C-FFI is quite good, the `bindgen`/`cbindgen` stuff is ok, but not amazing.
I have a fair amount of experience with `cxx`, and even with `autocxx`. These tools show a lot of promise but are nowhere in the ballpark of `pybind11` in features, maturity, flexibility, or ease-of-use. It's early days on the Rust <-> C++ journey, which I appreciate might not be a huge concern for a lot of folks, but I depend on a lot of existing C++. My in-house thing ("alloy") is a big mess of `bindgen`/`cbindgen` and pain. It works ok but it's super counterintuitive at best that I budget like 5x the time to hoist something core up into Rust and I do for Python.
This is where I stand right now, too. I recently published an overview of Rust <-> C++ interoperability[0], and cxx is the most effective tool available IME, but OTOH even cxx is not there yet (mainly missing bindings for Option and iterators). However the space, especially with autocxx, is evolving rapidly.
Interesting! You're correct that it was not on my radar, don't really know why.
Looking at the repository, it looks like the output is a bunch of extern "C" functions, though. Does that mean that one must call eg destructors by hand? How are C++ exceptions handled? Is this sound in the presence of non-relocatable types (eg std::string)? If so, how? Also, this only handles the C++ -> Rust direction, right?
Anyway, thank you for letting me know of this project!
note that IME, pyo3 was nowhere near as stable and reliable than pybind (or boost::python), at least at the time I last used it (2y ago? I remember soundness issues around inheritance, and I got a bona fide segfault without any unsafe). Their packaging tool, maturin, was already insanely good by then though.
I’m grudgingly coming around to the idea that Rust is probably a rock-solid FFI story away from being a serious part of my kit (pybind11 good, not like anything we have now).
But there is this in-between place where first-class linear/affine typing could be bootstrapped off of move semantics.