2 ms·
>"Rust isn't unlike C either. You can write a lot of it in a pretty C like fashion." I think that with all of the Rust's borrowing rules the statement is very
by FpUser 10mo ago
>"Rust isn't unlike C either. You can write a lot of it in a pretty C like fashion."
I think that with all of the Rust's borrowing rules the statement is very iffy.
- simonask 10mo agoC has a lot of the same borrowing rules, though, with some differences around strict aliasing versus the shared/exclusive difference in Rust. Most of the things people stub their toe on in Rust coming from C are already UB in C.
- cogman10 10mo agoRust's borrowing rules might force you to make different architecture choices than you would with C. But that's not what I was thinking about. For a given rust function, where you might expect a C programmer to need to interact due to a change in the the C code, most of the lifetime rules will have already been hammered out before the needed updates to the rust code. It's possible, but unlikely, that the C programmer is going to need to significantly change what is being allocated and how.
- FpUser 10mo agoNot talking allocations, more like actual borrowing, aliasing, passing as parameters.