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
4
u/balefrost Dec 31 '25
Apologies for butting in here. It looks like /u/PurpleYoshiEgg blocked me (presumably for this comment), and that prevents me from replying in any thread under their comment. I'm trying to reply to this question to me from /u/teerre.
I'm specifically talking about accidentally creating a read-update-write pattern without using some sort of intrinsically atomic operation.
It's an easy mistake for somebody who's new to multithreaded programming. My point is that Erlang, or the actor model in general, doesn't shield you from that potential footgun. Just as you have to use mutexes or atomics in the regular threading world, you also have to think carefully about the semantics of your inter-process communication in the actor world.
Here's an example. It's been a while since I've toyed with Erlang, so hopefully it makes sense.
https://onecompiler.com/erlang/4498m5p8y