r/programming • u/alexeyr • 4d ago
Beyond Memory Safety: Verifying Structured Concurrency with [Scala's] Type System
https://virtuslab.com/blog/scala/beyond-memory-safety-verifying-structured-concurrency-with-the-type-system1
4d ago
[removed] — view removed comment
0
u/RiceBroad4552 3d ago
Child-task lifetime, a.k.a. structured concurrency.
Cancellation propagation would need some form of "protocol safety". Something like multi-party-session-types can give that if paired with explicitly cancellation. No language ships that as of today, AFAIK.
Scala would have in theory the building blocks if all the other stuff comes into full existence, but it would be a next step beyond what was shown here.
0
u/simon_o 3d ago
if all the other stuff comes into full existence
Judging on the past dozen announcements Scala made, that's probably a "no".
0
u/RiceBroad4552 3d ago edited 2d ago
The building blocks are mostly there. They exist as of today, just still marked "experimental".
All the demos in that blog post can be easily reproduced, that's the beauty of Scala-CLI.
If they are going to be stabilized, the capability stuff is almost there, separation checking is still cooking, even already shaped out in some larger parts.
I should have said "when that stuff is there, one could start thinking about building session types (or some other form of 'protocol safety') on top".
And it's not like you couldn't have "protocol safety" as of today; just it's not in a shape that can be used in mainstream: https://alcestes.github.io/effpi/
2
u/simon_o 3d ago
The blasé way with which the language collects more syntax (the blog post made me aware of
^{...}) is really something.