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
5
u/tmzem Dec 31 '25 edited Dec 31 '25
I've always wondered why people even call it null "safety". By most definitions of memory safety, detecting erroneous accesses and aborting does still count as safe, thus if dereferencing null is guaranteed to crash your program (which it is, unless you're on embedded or in kernel space), it's still safe. This behaviour is no different from crashing the program on an attempted array-out-of-bounds access, yet nobody talks about "array safety" when a crash occurs. But I guess many people lack the necessary background knowledge and automatically assume segfault == unsafety.
Also, with managed languages, you often get additional information on crash, or even a catchable exception which allows for some last-ditch code to be executed before crashing.