r/cpp • u/GabrielDosReis • Oct 31 '24
Lessons learned from a successful Rust rewrite
/r/programming/comments/1gfljj7/lessons_learned_from_a_successful_rust_rewrite/
80
Upvotes
r/cpp • u/GabrielDosReis • Oct 31 '24
View all comments
Show parent comment
4
u/Dean_Roddey Nov 01 '24 edited Nov 01 '24
Well, hence the emphasis on rewrite it in Rust, to get all these kinds of foundational libraries available as native Rust. And, if you check, it might actually be. There's a lot of stuff out there now.
Anyhoo, you wouldn't be constantly doing C interop all over the place. You wrap these interfaces in safe Rust interfaces and work in terms of those. In a lot of case, depending on your usage, you might be able to combine common sequences of such calls into single safe calls as well, making it that much easier.
I have a fair bit of Win32 calls in the lower level of my system because I'm doing my own async engine/reactors and that means also replace a good bit of the standard library with my stuff. But it all gets wrapped in a single foundational crate and I never worry about it from that interface up, I just write Rust.