Earlier quoted context omitted.
I’m using cxx/cxx-qt in a Rust QT app with substantial interop with Qt/QML and lots of C++ code (because Gpt/Claude make implementing some stuff easier in C++). It’s definitely mature enough because Qt’s libs are no joke. At this point I have a Claude project set up with Cxx documentation and it autogenerates most of my bindings.
Do you have some specific usage of Claude to help? Or how do you use Claude/Gpt for this more precisely?
Zngur: A C++/Rust interop tool
11–20 of 33 posts
Re: Zngur: A C++/Rust interop tool
#12I've been learning Rust and really enjoying it, but the primary downside (compared to C++) is the lack of access to the large, well-tested libraries that exist in C++. For example, my work would benefit from using the CGAL library [0], something that be nontrivial to rewrite in Rust. As much as I like Rust, at some point it's a better idea to use C++ to tap into libraries like that. Does anyone have thoughts about ho…
I’m using cxx/cxx-qt in a Rust QT app with substantial interop with Qt/QML and lots of C++ code (because Gpt/Claude make implementing some stuff easier in C++). It’s definitely mature enough because Qt’s libs are no joke. At this point I have a Claude project set up with Cxx documentation and it autogenerates most of my bindings.
I'm a fan of QML and would love to use Rust with it if pleasant Qt bindings are finally there.
Re: Zngur: A C++/Rust interop tool
#13I've been learning Rust and really enjoying it, but the primary downside (compared to C++) is the lack of access to the large, well-tested libraries that exist in C++. For example, my work would benefit from using the CGAL library [0], something that be nontrivial to rewrite in Rust. As much as I like Rust, at some point it's a better idea to use C++ to tap into libraries like that. Does anyone have thoughts about ho…
So, Zngur allows you to use arbitrary Rust types in C++, store them by value in the C++ stack, and call arbitrary Rust methods and functions on them. But it doesn't bridge any C++ type into Rust, since it is not possible with the same ergonomic You want to use C++ libraries from Rust. This only does interop the other way.
https://hkalbasi.github.io/zngur/tutorial.html#calling-c-fro...
It sound like your quoted text is just saying that it’s not as ergonomic, you cannot use arbitrary C++ types directly in Rust, but you can use arbitrary Rust types in C++.
Re: Zngur: A C++/Rust interop tool
#14I've been learning Rust and really enjoying it, but the primary downside (compared to C++) is the lack of access to the large, well-tested libraries that exist in C++. For example, my work would benefit from using the CGAL library [0], something that be nontrivial to rewrite in Rust. As much as I like Rust, at some point it's a better idea to use C++ to tap into libraries like that. Does anyone have thoughts about ho…
I’m using cxx/cxx-qt in a Rust QT app with substantial interop with Qt/QML and lots of C++ code (because Gpt/Claude make implementing some stuff easier in C++). It’s definitely mature enough because Qt’s libs are no joke. At this point I have a Claude project set up with Cxx documentation and it autogenerates most of my bindings.
Re: Zngur: A C++/Rust interop tool
#15Re: Zngur: A C++/Rust interop tool
#16I've been learning Rust and really enjoying it, but the primary downside (compared to C++) is the lack of access to the large, well-tested libraries that exist in C++. For example, my work would benefit from using the CGAL library [0], something that be nontrivial to rewrite in Rust. As much as I like Rust, at some point it's a better idea to use C++ to tap into libraries like that. Does anyone have thoughts about ho…
If you want to immediately use a C++ library in Rust with minimal manual effort, check out autocxx [0]. Its generated api isn't very idiomatic Rust, and it uses Pin, moveit, ... but it covers a good percent of C++ apis and you can also make an idiomatic wrapper for it in Rust.
Re: Zngur: A C++/Rust interop tool
#17Earlier quoted context omitted.
I’m using cxx/cxx-qt in a Rust QT app with substantial interop with Qt/QML and lots of C++ code (because Gpt/Claude make implementing some stuff easier in C++). It’s definitely mature enough because Qt’s libs are no joke. At this point I have a Claude project set up with Cxx documentation and it autogenerates most of my bindings.
Can you talk more any you Claude use?
Re: Zngur: A C++/Rust interop tool
#18I've been learning Rust and really enjoying it, but the primary downside (compared to C++) is the lack of access to the large, well-tested libraries that exist in C++. For example, my work would benefit from using the CGAL library [0], something that be nontrivial to rewrite in Rust. As much as I like Rust, at some point it's a better idea to use C++ to tap into libraries like that. Does anyone have thoughts about ho…
So, Zngur allows you to use arbitrary Rust types in C++, store them by value in the C++ stack, and call arbitrary Rust methods and functions on them. But it doesn't bridge any C++ type into Rust, since it is not possible with the same ergonomic You want to use C++ libraries from Rust. This only does interop the other way.
Re: Zngur: A C++/Rust interop tool
#19A far more important point is to address is that any FFI story with C++ that’s well executed is going to be great for the Rust ecosystem, and historically the community’s commitment to C++ interop has seemed tepid at best.
Even if one admits that Rust is strictly better than C++ for problems in the relevant domains, which seems an extraordinary claim that exceeds extraordinary evidence, there is still an ocean of C++ that we just can’t rewrite in even a decade, maybe not in a century.
There are use cases where Rust is just strictly a better choice: anything with an attack surface like a shell or an SSH daemon, or probably even a browser is an obvious candidate for a language with better reasoning about common attack vectors. I trust my Rust user land a lot more than my C userland.
But the “rewrite everything in Rust and push that via bad interop” is limiting the adoption of a cool language.
I’m a big fan of efforts to be more incremental.