Virtual thread support? ("write async like sync")

Wondering whether Mojo will support writing async code like writing synchronous code, like Java's virtual threads. Hoping to avoid the "function coloring" problem introduced by async/await. See also https://www.infoworld.com/article/3678148/intro-to-virtual-threads-a-new-approach-to-java-concurrency.html.
5 Replies
Heyitsmeguys
Heyitsmeguys8mo ago
Two other PLs that seem to have solved the function colouring problem are Go and Zig: https://kristoff.it/blog/zig-colorblind-async-await/ It's also claimed that effect generics can also solve the function colouring problem (explained in this video: https://youtu.be/MTnIexTt9Dk?si=1e4admSCER06nn-c)
Alex Gunnarson
Alex Gunnarson8mo ago
Nice, thanks for the additional info @Heyitsmeguys !
DanteOz
DanteOz7mo ago
I believe long term the concurrency model for mojo will look similar to a combination of python and swift. Chris Lattner wrote a manifesto of concurrency for swift that goes into his views more in depth. https://gist.github.com/lattner/31ed37682ef1576b16bca1432ea9f782
Gist
Swift Concurrency Manifesto
Swift Concurrency Manifesto. GitHub Gist: instantly share code, notes, and snippets.
Heyitsmeguys
Heyitsmeguys7mo ago
GitHub
Proposal For An Actor System Based On Mojo by reid-spencer · Pull R...
This is currently a work in progress. There are no code changes, just a proposal written in the proposals section. This was pre-approved by Chris Lattner in a conversation in June 2023. I will kee...
Want results from more Discord servers?
Add your server