paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Opportunistically Parallel Lambda Calculus

机会式并行 Lambda 演算
OOPSLA 9(OOPSLA2)2025匹配度 3/10 · 论文属于 PL 与 LLM/API 调用的交叉,提出 lambda 演算下的机会式求值并实现 Opal,但核心是运行时并行调度与语言语义,而非用户关注的静态分析、形式化验证、浮点程序分析或贝叶斯程序分析。虽然涉及 LLM 调用与 Agentic 式脚本场景,但未将静态分析应用于 Agentic 程序,也未用 LLM 改进程序分析。引用 2 inbox
Stephen Mell, Konstantinos Kallas, Steve Zdancewic, Osbert Bastani
crossref: 2026-09-10

AI 速览

一句话:提出基于 lambda 演算的机会式求值策略,自动并行分派独立外部调用并流式返回结果,并用 Opal 语言验证。

脚本语言常用于组合本地库、网络服务等外部调用,其执行时间往往被等待外部调用所主导,传统的单语言优化因此收效甚微。本文提出一种面向脚本语言的机会式(opportunistic)求值策略,建立在一个核心 lambda 演算之上:它自动识别相互独立的外部调用并并行分派,同时以流式方式返回结果。作者证明了该策略具有合流性,从而保证不改变程序员原本的语义意图,并证明每个外部调用最终都会被执行。该策略被实现为脚本语言 Opal。评估聚焦于调用 LLM 和其他 API 等重外部计算的程序:在五个脚本上对比多个先进基线,相比顺序执行的 Python,总运行时间最高提升 6.2 倍、延迟最高提升 12.7 倍,同时相比手工调优的异步 Rust 仅多出 1.3%–18.5% 的运行时间开销;在 Tree-of-Thoughts 这一 LLM 推理方法上,相比作者自己的实现取得 6.2 倍加速。

问题
脚本语言组合大量外部调用(本地库、网络服务、LLM API)时,执行时间主要由等待外部调用主导,传统面向单语言的优化无法奏效。
方法
提出一种建立在核心 lambda 演算上的机会式求值策略,自动并行分派彼此独立的外部调用并流式返回结果,并证明其合流性(不改变程序员意图)与每个外部调用最终都会执行;实现为脚本语言 Opal。
评估
在五个以 LLM 及其他外部 API 为主的脚本上与多个先进基线对比,测量总运行时间与延迟,并与手工调优的异步 Rust 实现对照;此外在 Tree-of-Thoughts 上与原作者实现比较。
原文摘要(Abstract)

Scripting languages are widely used to compose external calls such as native libraries and network services. In such scripts, execution time is often dominated by waiting for these external calls, rendering traditional single-language optimizations ineffective. To address this, we propose a novel opportunistic evaluation strategy for scripting languages based on a core lambda calculus that automatically dispatches independent external calls in parallel and streams their results. We prove that our approach is confluent, ensuring that it preserves the programmer’s original intent, and that it eventually executes every external call. We implement this approach in a scripting language called Opal . We demonstrate the versatility and performance of Opal , focusing on programs that invoke heavy external computation through the use of large language models (LLMs) and other APIs. Across five scripts, we compare to several state-of-the-art baselines and show that opportunistic evaluation improves total running time (up to 6.2×) and latency (up to 12.7×) compared to standard sequential Python, while performing very close (between 1.3% and 18.5% running time overhead) to hand-tuned manually optimized asynchronous Rust. For Tree-of-Thoughts, a prominent LLM reasoning approach, we achieve a 6.2 × performance improvement over the authors’ own implementation.

链接与引用

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

BibTeX
@article{paperbot3026,
  title = {Opportunistically Parallel Lambda Calculus},
  author = {Stephen Mell and Konstantinos Kallas and Steve Zdancewic and Osbert Bastani},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763143}
}