Google Contributes $1M to Rust Foundation to Support C++/Rust Interop Initiative(foundation.rust-lang.org)
foundation.rust-lang.org
Google Contributes $1M to Rust Foundation to Support C++/Rust Interop Initiative
https://foundation.rust-lang.org/news/google-contributes-1m-to-rust-foundation-to-support-c-rust-interop-initiative/
1 comments
Swift is doing it, so rust can as well.
There's also degrees of interop - there's "rust can call a c++ dylib directly" but there's also "rust and c++ can be co-compiled". The latter is the critical path for migrating large projects from C++ to safer languages, because what you really want is to be able to replace your implementation class-by-class or file-by-file. Without a good interop story you have to essentially replace huge amounts of code in a single shot, and as the minimum subset increases in size the plausibility of successfully completing such rewriting gets lower and lower. It's a large part of why despite originating rust, mozilla has been unable to rewrite gecko in rust.
Creating a C wrapper is not a solution for the problem of migration.
There's also degrees of interop - there's "rust can call a c++ dylib directly" but there's also "rust and c++ can be co-compiled". The latter is the critical path for migrating large projects from C++ to safer languages, because what you really want is to be able to replace your implementation class-by-class or file-by-file. Without a good interop story you have to essentially replace huge amounts of code in a single shot, and as the minimum subset increases in size the plausibility of successfully completing such rewriting gets lower and lower. It's a large part of why despite originating rust, mozilla has been unable to rewrite gecko in rust.
Creating a C wrapper is not a solution for the problem of migration.
> I usually expose an C api from the C++ lib, and wrap the C api in C++.
Possibly it will be about polishing/automating this kind of flow.
Possibly it will be about polishing/automating this kind of flow.
C++ is hardly interoperable with itself. Keeping abi stability is a nightmare.
I usually expose an C api from the C++ lib, and wrap the C api in C++.
The article does not give any technical details but some vague AI stuff and improve tools etc.