paperbot · PL 论文追踪

全部论文 待读 收藏

P2 HasChor: Functional Choreographic Programming for All (Functional Pearl)

HasChor:面向所有人的函数式编排编程(Functional Pearl)
ICFP 7(ICFP)2023匹配度 1/10 · 该论文研究函数式编排编程与分布式系统实现,属于编程语言与分布式领域,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 22 inbox
Gan Shen, Shun Kashiwa, Lindsey Kuper
crossref: 2026-09-10

AI 速览

一句话:提出基于 monad 的函数式编排编程模型,支持高阶与位置多态编排,并实现为 Haskell 库 HasChor。

编排编程是一种面向分布式系统的新兴范式:程序员用单一全局程序描述整个系统行为,再通过 endpoint projection 编译为各节点程序。本文提出函数式编排编程的新模型,将 choreography 表示为 monad 中的计算,并支持高阶 choreography(可作为参数传递)与位置多态 choreography(可抽象节点),从而提升模块化与代码复用。该模型实现为 Haskell 库 HasChor,使日常 Haskeller 能直接使用丰富的 Haskell 生态编写编排程序;得益于 Haskell 的抽象,库本身实现简洁,endpoint projection 被归结为简短而本质的形式。

问题
如何以函数式方式统一描述分布式系统,并通过 endpoint projection 生成各节点程序,同时支持模块化与代码复用?
方法
将 choreography 建模为 monad 计算,支持高阶与位置多态 choreography,并实现为 Haskell 库 HasChor。
评估
通过 Haskell 库实现展示可用性与简洁性:用户可复用 Haskell 生态,endpoint projection 实现被大幅简化。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1908,
  title = {HasChor: Functional Choreographic Programming for All (Functional Pearl)},
  author = {Gan Shen and Shun Kashiwa and Lindsey Kuper},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {ICFP},
  year = {2023},
  doi = {10.1145/3607849}
}