Skip to main content
QUICK REVIEW

[Paper Review] Choreographies for Reactive Programming

Marco Carbone, Fabrizio Montesi|arXiv (Cornell University)|Jan 24, 2018
Formal Methods in VerificationComputer Science4 references5 citations
TL;DR

This paper introduces Governed Components (GC), a language that unifies reactive programming with choreographic specifications to enable modular, composable, and provably correct distributed systems. By decoupling component behavior from communication protocols, GC ensures type-safe, correct-by-construction interaction through runtime choreography enforcement, enabling flexible substitution of components across different protocols while preserving communication safety and progress.

ABSTRACT

Modular programming is a cornerstone in software development, as it allows to build complex systems from the assembly of simpler components, and support reusability and substitution principles. In a distributed setting, component assembly is supported by communication that is often required to follow a prescribed protocol of interaction. In this paper, we present a language for the modular development of distributed systems, where the assembly of components is supported by a choreography that specifies the communication protocol. Our language allows to separate component behaviour, given in terms of reactive data ports, and choreographies, specified as first class entities. This allows us to consider reusability and substitution principles for both components and choreographies. We show how our model can be compiled into a more operational perspective in a provably-correct way, and we present a typing discipline that addresses communication safety and progress of systems, where a notion of substitutability naturally arises.

Motivation & Objective

  • To address the tension between reusability in component-based systems and the need for strict communication protocols in distributed environments.
  • To enable components to be reused across multiple protocols without reimplementation, by decoupling behavior from communication choreographies.
  • To provide a formal model where choreographies govern component interactions at runtime, ensuring communication safety and progress.
  • To support a novel substitution principle where components can be used in different protocols as long as their reactive behavior satisfies the protocol's requirements.
  • To formally compile GC programs into a concurrent process model with operational correspondence, ensuring semantic correctness.

Proposed method

  • The model introduces reactive components with binders that dynamically produce outputs upon input availability, enabling flexible, data-driven computation.
  • Choreographies are first-class entities that specify the sequence and structure of inter-component communication, acting as runtime coordinators.
  • A compiler translates GC programs into a concurrent process model with standard I/O primitives, preserving operational semantics via an operational correspondence result.
  • A typing discipline is defined to ensure communication safety and progress, with subtyping that supports component substitution across protocols.
  • The approach separates component behavior (reactive) from communication structure (choreographic), enabling independent evolution and reuse.
  • The model supports substitution not only by interface but by behavioral capability, allowing components to be used in protocols requiring different numbers or orders of interactions.

Experimental results

Research questions

  • RQ1Can reactive components be composed in a way that preserves communication safety and progress while enabling reuse across different protocols?
  • RQ2How can choreographies be used as first-class runtime coordinators to govern component interactions without hardcoding communication sequences?
  • RQ3What is the formal relationship between component behavior and protocol compliance in a modular, composable setting?
  • RQ4Can a substitution principle be defined that allows components to be reused across protocols with varying numbers or orders of interactions?
  • RQ5How can a provably correct compilation strategy be designed to translate high-level choreographic components into operational concurrent processes?

Key findings

  • The proposed language model, Governed Components (GC), successfully decouples component behavior from communication protocols, enabling modular and composable system design.
  • The compiler from GC to a concurrent process model preserves operational semantics, as proven by an operational correspondence result.
  • The typing discipline ensures communication safety and progress, with a subtyping relation that supports flexible component substitution across protocols.
  • The model supports a novel substitution principle: components can be reused in protocols requiring different numbers or orders of interactions, as long as their reactive behavior satisfies the protocol's requirements.
  • The approach enables abstraction from message ordering and number of reactions, significantly improving reusability in distributed systems.
  • The model is positioned between Multiparty Session Types and Choreographic Programming, offering runtime choreography governance not found in static type systems or monolithic choreographic languages.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.