145
C++ creator rebuts White House warning
(www.infoworld.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
You can do that in basically any language. Rust even has the ability to break out of its safeguards and write unsafe Rust code.
"Memory safety" in this context is more about the defaults and how easy it is to write unsafe code accidentally.
Unsafe Rust really just let's you play with pointers
This is the entirety of what Unsafe Rust allows
I'm still onboard with rust as being better than C, however...
My understanding is that it is considerably harder to correctly write unsafe rust than it is to correctly write c, because if you accidentally violate any of safe rust's guaranteed invariants in an unsafe block, things go bananas.
That depends a lot on how you define "correct C".
It is harder to write rust code than C code that the compiler will accept. It is IMHO easier to write rust code than to write correct C code, in the sense it only uses well defined constructs defined in the C standard.
The difference is that the rust compiler is much stricter, so you need to know a lot about details in the memory model, etc. to get your code past the compiler. In C you need the same knowledge to debug the program later.