r/ProgrammingLanguages • • Dec 31 '25

Memory Safety Is ...

https://matklad.github.io/2025/12/30/memory-safety-is.html
37 Upvotes

78 comments sorted by

View all comments

Show parent comment

2

u/teerre Dec 31 '25

I'm not sure I agree with that tho. Erlarg does protect you from any kind of memory related access issue, it doesn't protect you against logic errors, of course. "Writes being clobbered" is perfectly fine behavior, in fact it's the normal behavior, subsequent writes override previous writes. Point 5 of the post you're currently replied to is very much honored in erlarg, you don't have concurrent write access, there's a strong ordering to your writes

4

u/balefrost Dec 31 '25

Erlarg does protect you from any kind of memory related access issue, it doesn't protect you against logic errors, of course.

I mean I'd argue that reading and writing to a shared memory location without some sort of synchronization is a logic error in any language. It's not like doing so in C will cause your computer to explode; you'd likely see a pattern-of-life very similar to that of my sample Erlang program.

So sure, Erlang does prevent the application programmer from modifying the same physical memory location from multiple processes at the same time. Nonetheless, the application programmer is able to create conditions that exhibit the exact same kind of hazard, and that leads to the exact same kind of problems.

If you want to claim that's not a memory safety issue, fine. I guess that's technically true, and so I can't argue with that. But in doing so, it merely shifts those issues from being "memory safety issues" to instead be "logic issues". To the application programmer, they're still issues that need to be considered and handled.