Convex has a Rust client!
So, always on the search for something wacky and interesting to do, I decided to use it to reimplement "The Santa Claus Problem" from Simon Peyton-Jones' 2007 paper "Beautiful Concurrency". In that paper, Simon used a simulated work group scenario to demonstrate the power and ergonomics of Software Transactional Memory-a way to represent atomic transactions as side-effect free "normal" code (ahem, to whatever extent Haskell is "normal", at least). Convex's mutations are heavily inspired by Haskell STM.
For the Rust/Convex version, instead of a single process with multiple threads and STM, I built a true multi-process distributed system using a Convex deployment as the shared state. I chose with project with three goals:
- Explore ways to use Convex's ACID properties to ensure correct behavior of distributed agents
- Demonstrate how to use Convex for server-side "workflow" patterns, where different agents signal to each other that it's time to advance the collective work
- Ensure the world's children get presents made and delivered in an efficient and timely manner
Give it a read and let me know what you think!
https://stack.convex.dev/get-rusty-with-santa
And please, if you like Rust and you like Convex, give the new crate a whirl and show us what you made.