Choreographic programming is an emerging paradigm for programming distributed systems. In choreographic programming, the programmer describes the behavior of the entire system as a single, unified program -- a choreography -- which is then compiled to individual programs that run on each node, via a compilation step called endpoint projection. We present a new model for functional choreographic programming where choreographies are expressed as computations in a monad. Our model supports cutting-edge choreographic programming features that enable modularity and code reuse: in particular, it supports higher-order choreographies, in which a choreography may be passed as an argument to another choreography, and location-polymorphic choreographies, in which a choreography can abstract over nodes. Our model is implemented in a Haskell library, HasChor, which lets programmers write choreographic programs while using the rich Haskell ecosystem at no cost, bringing choreographic programming within reach of everyday Haskellers. Moreover, thanks to Haskell's abstractions, the implementation of the HasChor library itself is concise and understandable, boiling down endpoint projection to its short and simple essence.
翻译:舞蹈编程是编程分布系统的一种新兴范例。在编程编程中,编程者将整个系统的行为描述为一个单一、统一的编程 -- -- 舞蹈编程 -- -- 然后通过一个名为端点投影的编译步骤将编成每个节点上运行的单个程序。我们为功能舞蹈编程提供了一个新的模式,在编程中,舞蹈编程作为计算方式在月球中表现。我们的模型支持最先进的编程编程功能,使模块化和代码再利用成为可能:特别是,它支持更高层次的编程,在这个编程中,可以把舞蹈作为论据传送到另一个编程中,而位置 -- -- 即多层次的编程,在编程中,舞蹈编程可以抽象地超越节点。我们的模型在Haskeell图书馆Haschoor实施,让编程者免费地写舞蹈编程,同时使用丰富的Haskell生态系统,让日常的Haskellers能够接触到编程。此外,由于Haskell的抽象性、简单的HasChill 基本投影库本身可以理解。</s>