dtolnay / cxx

Safe interop between Rust and C++
https://cxx.rs
Apache License 2.0
5.68k stars 320 forks source link

Question: estimate workload to call functions from geogram #1333

Closed glennDittmann closed 3 months ago

glennDittmann commented 3 months ago

Hello fellow rustaceans, first of all thanks for this awesome interface between c++ and rust!

I have implemented some algorithms for my thesis in rust and now I need some geometric predicates, that are only present in c++ so far. Since I would like to stay in rust I would love to use cxx for that.

A popular c++ library I would like to call from my rust code is: geogram Alternatively, I could also use these robust predicates.

I have done the cxx tutorial.

My questions is: Can someone broadly estimate, how much implementation time/overhead would be necessary, to interoperate with one of the above c++ libraries? I would rather get some help from an experienced person beforehand, before I dive deeper into cxx and start something that might not be worth it. The algorithms I use are not super long, so the opposing alternative would be writing everything new in c++, but then I would also loose all of rusts beautiful features.

Thanks for your help in advance!

glennDittmann commented 3 months ago

For anyone looking for a similar thing:

I extracted Pluggable Software Modules (PSM) from geogram, which are dependecy-free header libraries. With that the bridge is built pretty easily.