paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Efficient Parallel Functional Programming with Effects

带效应的高效并行函数式编程
PLDI 7(PLDI)2023匹配度 2/10 · 论文研究并行函数式编程中的效应支持、纠缠管理与编译器实现,属于 PL/运行时与内存模型方向;与用户核心关注的 PL 与 AI/LLM 交叉、静态分析、浮点程序分析、贝叶斯程序分析均无直接关联,仅共享广义 PL 背景。引用 6 inbox
Jatin Arora, Sam Westrick, Umut A. Acar
crossref: 2026-09-10

AI 速览

一句话:提出支持纠缠与任意突变的技术,使并行函数式语言兼顾安全与性能。

并行函数式语言能避免数据竞争,但传统上性能不佳。层次化内存架构允许处理器独立分配和回收内存、无需同步,从而解决关键性能问题,但为保证堆间独立性的“解缠”而限制突变/内存效应。本文提出支持“纠缠”并允许函数式程序任意使用突变的技术:区分解缠与纠缠对象,使解缠对象免受纠缠管理开销,并以内存对象为粒度形式化纠缠,定义成本度量以分析时间和空间开销。作者扩展 Parallel ML 的 MPL 编译器,支持其全部特性(包括无限制效应)。基准测试显示相较顺序执行仅有小的时间和空间开销,扩展性良好,并与 C++、Go、Java、OCaml 等语言竞争。

问题
并行函数式语言虽能避免数据竞争,却因内存管理同步等问题性能不佳;近期层次化内存方案依赖 disentanglement,限制突变/内存效应,难以支持任意效应。
方法
本文通过区分 disentangled 与 entangled 对象、屏蔽 disentangled 对象的纠缠管理开销来支持 entanglement 与任意突变,并以内存对象为粒度给出形式语义和成本度量;在 MPL 编译器中为 Parallel ML 实现这些技术。
评估
扩展后的编译器支持 Parallel ML 全部特性(含无限制效应),并用多种基准测试评估:相较顺序运行仅有小的时间与空间开销,扩展性好,且性能可与 C++、Go、Java、OCaml 竞争。
原文摘要(Abstract)

Although functional programming languages simplify writing safe parallel programs by helping programmers to avoid data races, they have traditionally delivered poor performance. Recent work improved performance by using a hierarchical memory architecture that allows processors to allocate and reclaim memory independently without any synchronization, solving thus the key performance challenge afflicting functional programs. The approach, however, restricts mutation, or memory effects, so as to ensure "disentanglement", a low-level memory property that guarantees independence between different heaps in the hierarchy.This paper proposes techniques for supporting entanglement and for allowing functional programs to use mutation at will. Our techniques manage entanglement by distinguishing between disentangled and entangled objects and shielding disentangled objects from the cost of entanglement management. We present a semantics that formalizes entanglement as a property at the granularity of memory objects, and define several cost metrics to reason about and bound the time and space cost of entanglement. We present an implementation of the techniques by extending the MPL compiler for Parallel ML. The extended compiler supports all features of the Parallel ML language, including unrestricted effects. Our experiments using a variety of benchmarks show that MPL incurs a small time and space overhead compared to sequential runs, scales well, and is competitive with languages such as C++, Go, Java, OCaml. These results show that our techniques can marry the safety benefits of functional programming with performance.

链接与引用

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

BibTeX
@article{paperbot1941,
  title = {Efficient Parallel Functional Programming with Effects},
  author = {Jatin Arora and Sam Westrick and Umut A. Acar},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591284}
}