paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Special Delivery: Programming with Mailbox Types

特快专递:基于邮箱类型的编程
ICFP 7(ICFP)2023匹配度 2/10 · 该论文属于编程语言与类型系统领域的静态分析工作,关注 actor 邮箱通信协议与死锁,但不涉及用户核心研究方向中的 ML/LLM/Agentic 程序、浮点程序分析或贝叶斯程序分析;其中“actor”也并非用户画像所指的 LLM 交互式 Agentic 程序。引用 11 inbox
Simon Fowler, Duncan Paul Attard, Franciszek Sowul, Simon J. Gay, Phil Trinder
crossref: 2026-09-10

AI 速览

一句话:提出首个融入邮箱类型的编程语言 Pat,并用算法化类型系统静态防范 actor 通信协议错误与死锁。

Actor 语言通过邮箱实现异步单向通信,适合可靠可扩展的分布式系统,但 actor 仍可能违反通信协议或发生死锁。邮箱类型由 de’Liguoro 与 Padovani 提出,以交换正则表达式刻画邮箱内容,此前仅用于进程演算。由于别名和嵌套求值上下文,将其迁移到编程语言颇具挑战。本文提出 Pat,首个融入邮箱类型的编程语言,并给出算法化类型系统;借助准线性类型控制别名复杂性,并通过新颖的后向双向类型推导实现共上下文类型检查,且证明其相对声明式类型系统既可靠又完备。作者实现原型类型检查器,并用工厂自动化案例和 Savina actor 基准示例展示 Pat 的表达能力。

问题
Actor 语言的邮箱通信虽避免了共享内存并发问题,但仍易受协议违反和死锁影响;如何将面向进程演算的邮箱类型引入实际编程语言并处理别名与嵌套上下文是核心问题。
方法
提出 Pat 语言及其算法化类型系统,使用准线性类型与后向双向类型推导实现共上下文类型检查,并证明其相对声明式系统可靠且完备。
评估
实现原型类型检查器,在工厂自动化案例和 Savina actor 基准套件的一系列例子上验证表达能力和实用性。
原文摘要(Abstract)

The asynchronous and unidirectional communication model supported by mailboxes is a key reason for the success of actor languages like Erlang and Elixir for implementing reliable and scalable distributed systems. While many actors may send messages to some actor, only the actor may (selectively) receive from its mailbox. Although actors eliminate many of the issues stemming from shared memory concurrency, they remain vulnerable to communication errors such as protocol violations and deadlocks. Mailbox types are a novel behavioural type system for mailboxes first introduced for a process calculus by de’Liguoro and Padovani in 2018, which capture the contents of a mailbox as a commutative regular expression. Due to aliasing and nested evaluation contexts, moving from a process calculus to a programming language is challenging. This paper presents Pat, the first programming language design incorporating mailbox types, and describes an algorithmic type system. We make essential use of quasi-linear typing to tame some of the complexity introduced by aliasing. Our algorithmic type system is necessarily co-contextual, achieved through a novel use of backwards bidirectional typing, and we prove it sound and complete with respect to our declarative type system. We implement a prototype type checker, and use it to demonstrate the expressiveness of Pat on a factory automation case study and a series of examples from the Savina actor benchmark suite.

链接与引用

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

BibTeX
@article{paperbot1919,
  title = {Special Delivery: Programming with Mailbox Types},
  author = {Simon Fowler and Duncan Paul Attard and Franciszek Sowul and Simon J. Gay and Phil Trinder},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {ICFP},
  year = {2023},
  doi = {10.1145/3607832}
}