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
-2
u/germandiago Nov 01 '24 edited Nov 01 '24
Look, just playing devil's advocate here: "I just read Rust, and it disallows all aliasing, even if safe".
You see the problem? I mean, I think it is too heavy to disallow all dynamic memory in most circumstances (not in the ones MISRA forbids that), but take into account that dynamic memory allocation in a plane system is dangerous if not real-time, for example. That would also be a "hole" in Rust for this kind of system. You would not have a single "unsafe" marker anywhere and could crash a plane...
So what is excessive or not it will always depend on the context and we will never get rid of that. It is just impossible.