logoalt Hacker News

vlovich123today at 2:45 PM1 replyview on HN

One thing I don’t understand is how you can guarantee the lack of a distributed deadlock. I’m sure it’s covered in the underlying research, but just conceptually it’s hard to picture.

What stops a choreography where Claire send a message to Bob but Bob is waiting for Alice and Alice is waiting for Claire?

Is it like Rust memory safety where not all valid programs are accepted but all invalid programs are rejected?

I think some examples of the distributed code in action on a trivial and non trivial distributed example is more compelling than a 3d donut render


Replies

minrawstoday at 3:25 PM

You can think about it as a protocol.

The protocol doesn't describe "Claire sends" and "Bob receives" as two independent actions that wait for each other, it describes them as a single communication in the global program/state.

When it gets executed into code, every send already has a corresponding receive by construction, so you can't write something like "Claire sends to Bob while Bob is actually waiting for Alice" unless the protocol itself allowed that execution.

So the cycle you're describing can't just accidentally appear because of sync issues, because the assumption is a communication is represented correctly at each turn.

So yeah it kinda does limit the set of all possible programs since I would expect not everything can be encoded this way also seems hard to resolve this in practice without only allowing communication b/w Wyzer systems.

I am not very familiar with this topic in practice so OP would be the best person to answer this, I am quite intrigued by how it works in practice as well.