3 ms·
There is an effort to automate generating mid-level C bindings for C++ code automagically, to enable easier wrapping in high level Rust APIs, by an unofficial A
by virtualritz 6y ago
There is an effort to automate generating mid-level C bindings for C++ code automagically, to enable easier wrapping in high level Rust APIs, by an unofficial Academy [of Motion Pictures] Software Foundation group.
It is called C++-- [1].
At this time we only target the VFX C++ ecosystem but I'd be surprised if people wouldn't use (and extend) this to cover a broader set of C++ libs.
Maybe you can give an example of a C++ API that you deem not "translatable to C"?
[1] https://github.com/vfx-rs/cppmm https://github.com/vfx-rs/cppmm
- radarsat1 6y agoThat's kind of hilarious given the role that C++ to C compiler had in the early development of the language [1]. But sounds useful, thanks for the link. [1] https://en.wikipedia.org/wiki/Cfront https://en.wikipedia.org/wiki/Cfront
- virtualritz 6y agoThere is also this, [1], which wasn't on my radar until today: "Corrosion, formerly known as cmake-cargo, is a tool for integrating Rust into an existing CMake project. Corrosion is capable of importing executables, static libraries, and dynamic libraries from a crate." [1] https://github.com/AndrewGaspar/corrosion https://github.com/AndrewGaspar/corrosion
- gmueckl 6y agoFor example, OpenVDB uses templates with user provided arguments at the very heart of its tree structure. Similar things happen in PCL and CGAL. They are template-heavy libraries by design. OpenCV on the other hand seems to instantiate all possible variants of cv::Mat for their Python bindings. They don't such a big space of valid and useful template parameters and IIRC the specifics are abstracted away from the algorithms working on them.