Chorex - choreographic programming in Elixir

Chorex is a brand-new Elixir library for choreographic programming: Chorex provides a macro-based DSL that lets you describe how processes communicate to perform a computation. This top-down description of interacting processes is called a choreography. From this choreography, Chorex creates modules for each process that handle all the message-passing in the system. The interactions performed by the generated code will never deadlock by construction because the choreographic DSL ensures that no processes will be waiting on each other at the same time.

Read my announcement and a much longer write-up with examples:

6 Likes

This is immediately useful to my current projects. I’ve already written a fair amount of code so I may not pull in this lib directly but the concepts learned will help my development going forward. Thanks for this

1 Like

That’s good to hear! Do you have an example you could tell me/I could look at where this would be useful?

I’m dispatching jobs to processes configured at runtime. Something must dispatch the data to the correct processes based on some calculation and depending on the result of a certain process’s job, I may need to dispatch a job to one of the sibling processes.

But how I actually built it is using a process per job (instead of per job type and message passing between them) similar to a generic message queue