AI ETHICS AND GOVERNANCE
Aliasing-xor-mutation WITHOUT borrow-checker
burakemir: > This is of course true. However, that notion also used to be called "safety" (e.g. Cardelli's 2004 Type Systems handbook article). The use of "memory safety" seems more recent, and the nuance that these are the same requires a detailed understanding. Indeed "memory safety" is a term with many meanings. I have met people who do "memory safety proofs of Java programs", by which they mean "prove that the program does not throw null pointer exceptions". If we take that definition, a Rust program that panics is also not "safe". I am not aware of any definition of memory safety where Rust would fall in a different bucket than Java. burakemir: > So including concurrency in safety is a real differentiator. I don't think so. Java had safe concurrency since ~forever. In fact, I think Go is pretty much the only language that is often claimed to be safe without being thread-safe (in the sense of a no-UB guarantee for concurrent programs). Swift might fall into the same bucket depending on where you draw the line between the safe and unsafe fragment of the language, though nowadays Swift does have safe forms of concurrency so unlike Go they are at least trying. I agree that Rust does more than Java to prevent concurrency bugs. But the same is true for sequential code, e.g. Rust statically prevents iterator invalidation. So concurrency is not a differentiator here either. I don't think that this difference can be captured by saying that Rust is safe in a sense that Java is not. Rust has a stronger type system, but the additional strength does not manifest in new metatheoretical properties. > If you look at it this way, then among the widely used, modern no-GC languages, Rust does seem to hold a special place. And the claim that it is unique is not all that silly. "no-GC" is doing all the heavy lifting here. All the other no-GC languages are "obviously" not memory safe, as far as I can tell. So yes, I agree that Rust is unique in that it achieves memory safety without a GC. I already said that in my previous post. But there were claims further up this thread which seemed to say that Rust is unique for achieving memory safety at all, and that "memory safety without a borrow checker" would be somehow a new thing. Those are the claims I pushed back against. Your reply now argues for something entirely different.