to all of the statistical nerds out there counting memory errors in to justify the existence of : a logic error in a system that uses explicit memory management often culminates in a memory error. That doesn't make it a memory management error, it's still a logic error, and patching it up with more memory management is over-complicated at best and silently incorrect at worst.

@namark yes, so what Rust does, it doesn't let you compile it, so you would try and fix the problem, which would lead you to finding the logical error. It's not like Rust can somehow force you to fix only the memory management aspect separate from the underlying logic.

@isagalaev you can fix the memory issue that is reported to you, by introducing shared state or a copy where by program logic there should not be any shared state or a copy, making your memory management perfect, while your logical invariants are still utterly broken. Otherwise you need to understand the code regardless of the memory management to identify the logic error that led to a memory error or whatever else side effects. The point is when you count memory errors you get a metric ton of false positive logic errors in a language where memory is managed explicitly.

@namark I'm not going to argue that a determined programmer is perfectly able to sabotage their own code by insisting to fix errors in the most superficial, ill-advised way just to prove to the world that their dislike towards a language was justified :-)

Follow

@isagalaev I apologize I rustled your jimmies by speaking ill of your favorite language, but, wile I enjoy doing that periodically otherwise, notice please that I did not do that in the OP or my previous reply to your previous reply. My argument is rather specific, that rust's memory/resource safety does not guarantee mechanical elimination of all bugs naively deemed memory errors in c++. If you have an argument against that, please present it directly, and stop imagining that I'm trying to definitively prove rust useless for all intents and purposes with those couple of sentences I wrote in the OP. I might do that some other time, but with many more sentences.

If your argument is simply that in the cases I'm describing here, the good rust programmers will do the right thing, cause of the general expressiveness of the language, the same can be said about c++ (for the purposes of not making those logic errors in the first place), so it is in no way an advantage of rust to be counted in the statistic of "problem rust will definitely fix".

If your argument is that it is better than nothing, I will again point out that a wrong fix for a logic error is just as bad as the logic error, and rust in no way guarantees that it will be fixed correctly, as there is a myriad of ways to fix memory errors without addressing the underlying logic errors (and I'm talking about those cases where these underlying logic errors exist). You are back to square one with that, again relying on discipline of the programmer and general expressiveness of the language, not the memory safety.

Finally if your argument is that you predict that these logic errors that result in memory errors in c++ are not common enough to significantly affect any statistic, I would have to point our that your prediction, however justified, is not a statistical argument, so you might as well present it without collecting any statistics.

These are the more or less direct arguments I've encountered in this expansive subthread with @kornel, if you are interested:
mastodon.social/@kornel/107487

Please also keep in mind that if you are not a member of the "statistical nerds out there counting memory errors in c++ to justify the existence of rust" then the OP is not directly calling you out, regardless of your marital status with rust.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.