# Implementing a higher-order choreographic language

*2024-08-01 — idea*


This project aims to implement a functional choreographic language inspired by
the [Pirouette calculus](https://dl.acm.org/doi/pdf/10.1145/3498684). This language was meant to make the notoriously
difficult process of implementing distributed algorithms easier, while offering
a practical execution model for multi-participant programs. Additionally, it
aimed to match the expressiveness and performance of similar existing
solutions.

The project completed very successfully, and resulted in [*ChorCaml*](https://github.com/Rokcas/chorcaml), an
embedded DSL for choreographic programming in OCaml. The language facilitates
the implementation of distributed algorithms, while offering a clear syntax and
safety via the type system. ChorCaml also improves upon existing alternatives
in certain common use cases, both in terms of program conciseness and
performance. The practicality of the DSL was verified by successfully
implementing well-known distributed algortihms such as Diffie-Hellman key
exchange and concurrent Karatsuba fast integer multiplication.


[Rokas Urbonas](https://github.com/Rokcas) subsequently submitted a proposal to the OCaml Workshop about his
work, and presented it at the [2014 edition of the OCaml Workshop](https://icfp24.sigplan.org/details/ocaml-2024-papers/13/ChorCaml-Functional-Choreographic-Programming-in-OCaml).

- [Video](https://www.youtube.com/watch?v=KEkmcXVtFi0) of his talk
- [PDF](https://ocaml2024.hotcrp.com/doc/ocaml2024-paper17.pdf) of his writeup.
  
Status: Completed
Level: PartII
Year: 2024
Project: OCaml Labs
Supervisors: Dmirtij Szamozvancev, Anil Madhavapeddy
Students: Rokas Urbonas

---
Canonical: https://anil.recoil.org/ideas/choregraphic-programming-ocaml
Type: idea
License: CC BY 4.0 <https://creativecommons.org/licenses/by/4.0/>
Tags: distributed, ocaml, fp, consensus
