paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Virtualizing Continuations

虚拟化续延
PLDI 10(PLDI)2026匹配度 3/10 · 论文属于程序语言与运行时方向,研究词法效应处理器与多次性续延的实现,包含操作语义与正确性证明,兼具理论形式化和工程实现,这一点与你的部分偏好相符。但它不涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,与当前核心研究方向几乎没有直接交集。引用 0 inbox
Cong Ma, Jonghyun Jung, Yizhou Zhang
crossref: 2026-09-10

AI 速览

一句话:通过虚拟化续延所用的栈空间,在词法效应处理器中完整支持多次性续延,并带来并行执行性能收益。

效应处理器与多次性续延是管理控制流的强大抽象,可简洁模块化地表达非确定性、随机性等。然而在存在栈分配的词法资源(尤其是词法效应处理器)时实现多次性续延十分困难,因为栈复制会使对这些资源的引用失效。本文提出一种新的词法效应处理器实现策略,完整支持多次性续延:核心思想是虚拟化续延所使用的栈空间——为每个栈分配的处理器实例分配虚拟地址,所有经由这些虚拟地址的效应调用都由地址转换机制中介,运行时中的软件内存管理单元(MMU)利用效应处理器的词法作用域规律高效完成转换。作者为词法效应处理器给出新的操作语义,并证明其相对于标准语义的正确性,同时在编译器与运行时系统中实现该方案。与先前支持词法效应处理器的语言相比,该实现完整支持多次性续延从而提升表达力,并因此支持多次性续延的并行执行,带来显著性能提升。

问题
在词法效应处理器这类存在栈分配词法资源的场景下,多次性续延所需的栈复制会使对栈资源的引用失效,导致难以正确实现多次性续延。
方法
将续延使用的栈空间虚拟化:为每个栈分配的处理器实例分配虚拟地址,由地址转换机制中介效应调用,运行时中的软件 MMU 借助效应处理器的词法作用域规律高效完成翻译;并给出新的操作语义及其相对标准语义的正确性证明。
评估
在编译器与运行时系统中实现该策略,与先前的词法效应处理器语言比较表达力,并通过支持多次性续延的并行执行展示性能提升。
原文摘要(Abstract)

Effect handlers and multishot continuations are powerful abstractions for managing control flow; together, they offer concise and modular ways to express and handle nondeterminism, randomness, and more. However, implementing multishot continuations in the presence of stack-allocated lexical resources—lexical effect handlers in particular—is challenging, since stack copying invalidates references to these resources. We present a novel implementation strategy for lexical effect handlers that fully supports multishot continuations. The key idea is to virtualize the stack space used by continuations. Each stack-allocated handler instance is assigned a virtual address, and all effect invocations through these virtual addresses are mediated by an address translation mechanism. A software-based memory management unit in the runtime system performs these translations efficiently, exploiting the lexical scoping discipline of effect handlers. We capture the essence of our approach via a new operational semantics for lexical effect handlers and prove it correct with respect to the standard semantics. We also implement it in a compiler and runtime system. Compared to prior languages with lexical effect handlers, our implementation increases expressivity by fully supporting multishot continuations—and, as a happy consequence, unlocks significant performance gains by enabling parallel execution of multishot continuations.

链接与引用

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

BibTeX
@article{MaJZ26,
  title = {Virtualizing Continuations},
  author = {Cong Ma and Jonghyun Jung and Yizhou Zhang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {PLDI},
  year = {2026},
  doi = {10.1145/3808289}
}