logoalt Hacker News

reorder9695today at 1:33 PM1 replyview on HN

The difference I see there is any line in a C codebase could have these issues, whereas in Rust they're specifically marked as unsafe sections, with the language having a clear list of invariants it expects the programmer to uphold in an unsafe block. Additionally Rust has a culture of developers specifically justifying the unsafe block and why it's correct in comments. It's a massive reduction of the scope of the code that needs audited, that doesn't mean there can't be mistakes in it, just that it's easier to verify certain properties of the whole codebase.


Replies

bcjdjsndontoday at 2:43 PM

> The difference I see there is any line in a C codebase could have these issues

Not true.

> Additionally Rust has a culture of developers specifically justifying the unsafe block and why it's correct in comments

Yeah, if your on the message board. Wait til rust hits real world levels of usage and shit code begins to emerge....

It's easy to sit on that pedestal when your essentially a novelty language in comparison to amount of legacy code in production