-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace hand-rolled FFI with cxx #3426
Comments
WIP in my cxx-experiment branch |
@aktaboot suggests https://codeberg.org/pitbuster/dolphin-rom-thumbnailer/src/branch/main/src/CMakeLists.txt as an example that uses CMake, Corrosion, and the Corrosion CXX support ( |
More updates in the linked branch, if anyone wants to follow along. |
In particular, some notes here |
This approach looks really promising!
Am I correct in interpreting this to mean that you plan to vendor the cxx integration from corrosion? I was initially curious about the stability of this feature given the |
It seems to work even without vendoring it. I suspect we're not doing anything too exciting from corrosion's perspective, so maybe the EXPERIMENTAL bits are not problematic. Or, maybe it won't work on some other platform than mine :( |
I can test if there's PR :) |
Hey @n8henrie, I saw your issue in dtolnay/cxx#1327 -- I'm also deep in the weeds of CXX, although going the other way (supporting calling into Taskchampion from Taskwarrior). Would you be interested in joining forces? |
Yes, would love to pitch in as much as I can -- I gave a little more background in an email reply I just sent. My greatest interest / dream would be providing a rust library for TaskWarrior that would enable downstream work to reimplement the CLI and potentially other front-ends in rust (potentially cross-compiling to other architectures, etc.). As a disclosure, part of my motivation is that I don't know C++, which will limit the amount of help I can be! As we've mentioned in the past, my goal for https://github.com/n8henrie/taskwarrior-rs/ was to create FFI bindings to fulfill this purpose (and potentially could act as a bridge to progressively migrate the TW codebase to rust -- though I'm not sure how rust-friendly/interested the rest of the TW team is), but obviously my limited understanding of C++ makes that an extremely slow-going task. And as mentioned before, I'm more than happy to release the |
Corrosion Maintainer here. The experimental here means:
Implementation wise, I haven't touched this function in a while. As long as you read the changelog before upgrading corrosion, you should be fine. |
Thanks for having a look at Taskwarrior, @jschwe! |
I was mistaken in thinking this should be solved in the Taskchampion crate. That crate should be pretty much pure Rust, with other applications left to figure out how to link to it. That's how I've just set things up in #3209. |
Once GothenburgBitFactory/taskchampion#372 is done and 0.7.0 is released, I will push the |
That was #3588. |
There's a heavy load of both Rust and C++ code interfacing between Taskchampion and Taskwarrior. It's very tricky to get that stuff right, and easy to add UB.
One of the popular alternatives is https://cxx.rs/, which generates Rust and C++ glue for you. It's a little limited in that it only supports some basic types, but most of what we need is vectors and strings, so that should be OK.
The text was updated successfully, but these errors were encountered: