Any updates on calling C++ from Rust

D did it.

And apparently it's a huge pain in the ass.

Rust doesn't have many concepts that C++ does, and vice versa. For instance, C++ exceptions can mostly be caught in D, but that's not a thing in Rust at all. Templates could kinda get mapped to Rust generics, except I'm under the impression that'd be extremely fragile for many reasons. The memory model of classes is also, I believe, a significant FFI problem. C++ inheritance vs Rust trait-based polymorphism is also a weird one.

I haven't seen any meaningful description of a translation layer between Rust and C++, even in abstract. I'd certainly be curious to, though.

I doubt Rust/Qt is ever going to be a thing, which puts GNOME ahead of KDE on adopting us :grin:, but C++ linkage would surely be a nice feather in our cap.

1 Like