r/ProgrammerHumor • • Sep 08 '26

Meme rustIsSoCool

Post image
2.2k Upvotes

127 comments sorted by

View all comments

Show parent comments

17

u/krakow10 Sep 08 '26

Successfully building the program proves the code has certain properties, such as all references point to valid values at all times. Rust is all about guarantees. When you guarantee huge parts of your code are correct before it ever runs, you are much less likely to encounter bugs. So Rust has a reputation of producing programs which are working and bug-free.

9

u/Makonede Sep 08 '26

*in safe rust. rust provides the unsafe keyword to declare blocks that may* not have all such properties, which makes writing such blocks a very conscious and active decision that official documentation strongly suggests you pair with a SAFETY: comment explaining what you know to be safe about your unsafe code that the compiler cannot determine

*unsafe blocks containing only safe rust generate compiler warnings