r/ProgrammingLanguages • u/matklad • Dec 31 '25
Memory Safety Is ...
https://matklad.github.io/2025/12/30/memory-safety-is.html
37
Upvotes
r/ProgrammingLanguages • u/matklad • Dec 31 '25
View all comments
Show parent comment
1
u/reflexive-polytope Jan 03 '26
The problem with “memory safety” and “type safety” is that there's no single definition of them. Every language design has a set of errors that it seeks to prevent, and can only be meaningfully judged by whether it achieves this self-imposed goal, regardless of whether it helps you write correct programs for your purposes.
For example, Java allows data races, but guarantees that they won't break the JVM's state, and for this reason alone is considered “memory safe”. This is a completely useless property: it gives me zero comfort that the JVM protects itself while allowing my own abstractions and invariants to be thrashed by concurrency bugs in third-party code.
And that's before taking into account Java's reflection and instrumentation tools, which you can easily use to break other people's code. At this point, any invariants you might have proved of your Java classes are merely a suggestion.
tl;dr: Basically, I want languages that let me protect my abstractions.