HasChor:面向所有人的函数式编排编程(Functional Pearl)
HasChor: Functional Choreographic Programming for All (Functional Pearl)
AI总结:
本研究提出一种基于单子的函数式编排编程新模型,支持高阶与位置多态编排特性,并在Haskell库HasChor中实现,让普通Haskell开发者可便捷使用编排编程,且库实现简洁精炼。
摘要:
编排编程是一种新兴的分布式系统编程范式。在编排编程中,程序员将整个系统的行为描述为单个统一的程序——即编排(choreography),随后通过名为端点投影(endpoint projection)的编译步骤,将其编译为在每个节点上运行的独立程序。我们提出了一种函数式编排编程的新模型,其中编排被表示为单子(monad)中的计算。该模型支持实现模块化与代码复用的前沿编排编程特性:具体而言,它支持高阶编排(higher-order choreographies),即一个编排可作为参数传递给另一个编排;还支持位置多态编排(location-polymorphic choreographies),即编排可对节点进行抽象。我们的模型在Haskell库HasChor中实现,程序员可以在编写编排程序的同时免费使用丰富的Haskell生态系统,让日常Haskell开发者也能使用编排编程。此外,得益于Haskell的抽象机制,HasChor库本身的实现简洁易懂,将端点投影的本质提炼得简短精炼。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。