4 ms·
Plato was walking by Diogenes the Cynic and saw him with GDB up on his screen, figuring out a memory error. "If you would only code in Rust, you wouldn't have
by nataliste 2y ago
Plato was walking by Diogenes the Cynic and saw him with GDB up on his screen, figuring out a memory error.
"If you would only code in Rust, you wouldn't have to fix those bugs." To which Diogenes replied: "If you would only fix those bugs, you wouldn't have to code in Rust."
- deleted 2y ago[deleted]
- kelnos 2y agoI don't buy it. We have already learned empirically that "fix your bugs" (or, better, "don't write bugs in the guest place") is a failed solution to memory safety.
- furyofantares 2y agoPlus, Rust is fairly new and those guys died a while ago.
- nataliste 2y agoYou could say the same thing about knives.[0] "Treat your tools with respect" is a failed solution to tool safety. From 1980-2008, knives caused almost 1,200 emergency room visits per day, entirely avoidable by using safety tools and PPE.[0] Of course, this argument is silly. The absolute number of knives are used safely and without issue in the overwhelming majority of cases. Yes, there are times when someone was sloppy and sliced open their hand, but that doesn't make vigilance a failed solution to tool safety. The accidents that occur with them are in the realm of tolerable risk. C is fundamentally no different. The simplicity comes with footguns that frequently go off when used by people that don't treat them with respect and sometimes even when they are being treated with ample respect. Although, now that I think of it, bicycles are probably a better metaphor. It's a simple, unshielded vehicle designed not for safety but for getting you where you need to go. Accordingly, riding a bike without crashing requires understanding numerous edge cases that if not respected will end with you grievously injured and sometimes even with respect you won't escape crashing. This is such a truism in cycling communities that they say as a mantra "It's not a matter of if you crash, but when." You also have the subset of cyclists that ignore laws when using them and endanger themselves and others. Should we then ban bikes because precaution is a "failed solution" to prevent crashing and responsible use? Probably not. [0] https://www.jem-journal.com/article/S0736-4679(12)01624-1/abstract https://www.jem-journal.com/article/S0736-4679(12)01624-1/ab...
- Nathanba 2y agoThe footguns with C and memory errors are super subtle though and cause random crashes. It would be more like riding a bicycle with thousands and thousands of potential errors and if you ever make the tiniest mistake in the repair and upkeep of it, it crashes in the middle of a ride.
- pjmlp 2y agoThat is why there are laws in sensible countries for butchers to use chained gloves, or protection equipment when riding bycicles.
- timeon 2y ago> Of course, this argument is silly. It is not argument, it is analogy - made-up scenario.
- raverbashing 2y agoCorrect The work safety world disagrees with that thinking. And several workers pay with very painful consequences when they override safety to make things easier. And my advice for those who don't believe me is to go play and cut a tree with a chainsaw with a disabled kickback break and guards.
- throwawaymaths 2y agoBut we haven't proven that a type system is the place to track memory safety. Suppose we could have an automated memory safety bug report checker that isn't in the type system?
- deleted 2y ago[deleted]