paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Tracing Just-in-Time Compilation for Effects and Handlers

面向效应与处理器(effect handlers)的追踪即时编译
OOPSLA 9(OOPSLA2)2025匹配度 1/10 · 该论文研究 effect handlers 的 tracing JIT 编译,属于程序语言与编译器方向,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心关注点。与用户研究画像几乎没有直接交集。引用 0 inbox
Marcial Gaißert, CF Bolz-Tereick, Jonathan Immanuel Brachthäuser
crossref: 2026-09-10

AI 速览

一句话:首次评估面向效应处理器的追踪 JIT 编译,将 Eff、Effekt、Koka 编译到统一字节码并基于 RPython 实现,分析性能与优化效果。

效应处理器(effect handlers)支持非局部但结构化的控制流,可统一生成器、异常、异步等特性,但现有高效实现往往牺牲部分语言特性。追踪 JIT 通过解释器记录执行轨迹、动态识别热点循环并利用运行时信息激进优化,尤其擅长优化动态控制流,而这正是效应处理器所引入的。本文首次专门评估面向效应处理器的追踪 JIT 编译:作者将 Eff、Effekt、Koka 编译到统一的字节码格式,并基于 RPython 实现追踪 JIT,评估其性能,讨论哪些类型的效应程序能被良好优化以及新增优化对性能的影响,并与主流语言实现基线进行对比。

问题
效应处理器的现有高效实现常常以牺牲语言特性为代价,而追踪 JIT 是否适合优化效应处理器引入的动态控制流尚不清楚。
方法
将 Eff、Effekt 与 Koka 编译到统一的字节码格式,并基于 RPython 为它们实现追踪 JIT 及若干额外优化。
评估
通过基准测试评估性能,分析哪些效应程序类别能被良好优化、额外优化的影响,并与主流语言实现基线进行对比。
原文摘要(Abstract)

Effect handlers are a programming language feature that has recently gained popularity. They allow for nonlocal yet structured control flow and subsume features like generators, exceptions, asynchronicity, etc. However, implementations of effect handlers currently often sacrifice features to enable efficient implementations. Meta-tracing just-in-time (JIT) compilers promise to yield the performance of a compiler by implementing an interpreter. They record execution in a trace, dynamically detect hot loops, and aggressively optimize those using information available at runtime. They excel at optimizing dynamic control flow, which is exactly what effect handlers introduce. We present the first evaluation of tracing JIT compilation specifically for effect handlers. To this end, we developed RPython-based tracing JIT implementations for Eff, Effekt, and Koka by compiling them to a common bytecode format. We evaluate the performance, discuss which classes of effectful programs are optimized well and how our additional optimizations influence performance. We also benchmark against a baseline of state-of-the-art mainstream language implementations.

链接与引用

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

BibTeX
@article{paperbot3010,
  title = {Tracing Just-in-Time Compilation for Effects and Handlers},
  author = {Marcial Gaißert and CF Bolz-Tereick and Jonathan Immanuel Brachthäuser},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763085}
}