3 ms·
Rust is only “safe” because by default you’re not allowed to do certain things. If you applied those same limitations to C it would be just as if not more safe.
by tourmalinetaco 3y ago
Rust is only “safe” because by default you’re not allowed to do certain things. If you applied those same limitations to C it would be just as if not more safe. And the things you’re not allowed to do in “safe” Rust is required in various applications that C excels at, meaning that for Rust to do the same it has to be “unsafe”.
- bigstrat2003 3y agoNobody has ever denied that unsafe Rust code exists, so I don't know why people keep acting like it's some gotcha that invalidates the value of Rust. The point is that in Rust, it is clearly delimited where those unsafe operations are occurring, so you can focus on making sure those specific parts of your code are solid. In C, you have to be vigilant about your entire code base, not just a handful of blocks. Moreover, most Rust programs don't need to use unsafe at all, so those authors can rest easier.
- BirAdam 3y agoI am usually the first to say that Rust evangelists are annoying, but… your argument isn’t valid. That any tool can be dangerous when used wrongly enough is not an argument in favor of or against rust. Additionally, that any given tool might be better for a certain job over any other isn’t an argument for or against other tools more generally.
- empath-nirvana 3y ago> If you applied those same limitations to C it would be just as if not more safe. If frogs had wings, they wouldn't bump their butts when they hop. If you add all the security guarantees of Rust to C you would have something substantially similar to rust. As to your last point, it's very easy in rust to isolate those operations so you can just go over those with a fine tooth comb and not have to worry about unsafe stuff appearing everywhere in your code.