Remix.run Logo
abbefaria27 2 hours ago

What’s the story for Rust-C++ interoperability these days? That’s what kills adoption. Most C++ devs I know like the idea of Rust, but no one is going to go rewrite 30 years of working code. It needs to be something you can incorporate gradually.

afdbcreid 2 hours ago | parent | next [-]

There's an interop initiative by the Rust Foundation, there is a project goal to map the problem space, there was an effort to introduce an attribute (`#[rustc_splat]`) to allow calling overloaded functions, and there are various community-generated tools for more or less automated bindings generation.

nicoburns an hour ago | parent | prev | next [-]

There's a huge push for this from the big companies adopting Rust. Google has been developing https://github.com/google/crubit. The older cbdingen is still usable if more limited (it's what Firefox uses for some pretty involved interop).

kibwen an hour ago | parent | prev | next [-]

Rust's raison d'être is to improve the confidence of the security-critical parts of your system. You don't need to rewrite all 30M lines of code to benefit from it, you just need to identify the 1% of your codebase with the greatest attack surface (e.g. any internet-facing string parser), cordon that part of the codebase off with a C ABI, and then convert that part to Rust. This is similar to how Firefox incorporates bits of Rust into its own C++ codebase over time (e.g. for parsing URLs).

drop_star 2 hours ago | parent | prev [-]

ya our codebase is 30m lines of c++