2 ms·
Breaking down the full argument is very subtle, sure. But, at the outset, we can simply observe that the "safety" Rust provides is memory safety, which is a no
by mjburgess 4y ago
Breaking down the full argument is very subtle, sure.
But, at the outset, we can simply observe that the "safety" Rust provides is memory safety, which is a non-issue in a dynamic language.
To say that Rust is as safe, or more safe, than a dynamic lang is false. It's strictly less safe, since by construction, it is a language where allocation is managed by the programmer.
The whole argument about "saftey" in the sense Rust addresses is between languages of "manual allocation". To imagine that any of these language is "safer", is to have misunderstood a great deal. Rust is about enabling an otherwise C-programmer to limit the impact of manual memory handling, it is *not* to prevent eg,. use-after-free errors in javascript. Since there are no such errors by construction.
- tialaramex 4y agoThe same "by construction" safety applies to Safe Rust as to the dynamic GC'd languages you're discussing. You can't write a use-after-free error in Safe Rust, the same way you can't write one in Javascript. But, Safe Rust also chooses to construct safety that those GC'd languages don't have. The reason Javascript doesn't have data races for example is that it doesn't have concurrency - can't have a race with only one runner. Java does have data races (with limited but still unsettling consequences), Go's data races are really bad, like actual Undefined Behaviour bad in some cases. Whereas Safe Rust doesn't have data races - you can write concurrent Safe Rust but you can't write a data race. The difference you're grappling for probably feels intuitively like it should exist, but I assure you it does not.
- mjburgess 4y agoYou are right that the argument boils down to what we take "by construction" to mean. I will resolve this, simply, by saying whatever advertisement Rust makes for itself, is better made by any "dynamic" language. And if we're inclined to trade PR against PR, Rust looses. Managed memory has better PR. And so those repeating the Rust agitprop against managed languages are simply "NPCs for the wrong ideology".
- Yoric 4y agoI would articulate things differently. Theoretically, memory-safety between Rust and managed languages is equivalent. However, memory-safe languages (i.e. not Managed C++) running on a memory-safe VM have one more layer of defense in depth than Rust. This matters in case there is a bug in the compiler or any of the dependencies. Additional layers may include, for instance, Unix and containers. "dynamic" languages, though? That's entirely orthogonal to memory-safety and not very good for general software safety.