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/tmzem Dec 31 '25

Besides the rigorous single-writer discipline of Rust, worker threads with conceptually separate heaps, and the Actor model are other approaches to minimize data race issues. Each put severe constraints on what you can do, and especially the actor model is not the most natural fit for many problem domains.

0

u/PurpleYoshiEgg Dec 31 '25

But how does it prevail against point 5? Because there's no compile-time restraint (i.e. checked by the compiler), but a computation-level restraint as provided by the VM.

2

u/tmzem Dec 31 '25

Well, actors process one message at a time before processing the next message. From another actor's perspective each message send/receive and its associated processing is atomic. Of course, more complex patterns may be harder, as certain problems might need more complex communication patterns, or sending entire functions to the other actor in order to be processed there.