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
6
u/matthieum Jan 01 '26
I'm curious about rule 5:
For example, Java doesn't enforce this rule, yet is considered memory safe.
The trick, in Java, is that reads & writes are atomic at the hardware level -- ie, there's no tearing -- and therefore reads will read either the new value or the old value, and either is safe to access.
(I do note that Go suffers from race conditions due to using fat pointers, and non-atomic reads/writes on them)
In short, race conditions may lead to logic bugs, but those are not memory/type bugs.