paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Typed Intermediate Representation for Dynamic Languages

面向动态语言的类型化中间表示
TOPLAS 48(2)2026匹配度 3/10 · 论文属于程序语言与编译领域,提出动态语言的类型化 IR 并支持静态分析,但未涉及 LLM/Agent、ML 系统、浮点程序分析或贝叶斯程序分析,与用户核心交叉方向仅有间接关联。引用 0 inbox
Mickaël Laurent, Jakob Hain, Filip Křikava, Sebastián Krynski, Jan Vitek
crossref: 2026-09-10

AI 速览

一句话:提出类型化高层 IR,显式表达动态语言特性并支持特化、内联、作用域与拷贝消除等优化。

动态语言中的动态类型、晚绑定、反射、写时复制和延迟求值等特性,给优化编译器带来巨大挑战;编译器必须对动态行为进行推测并生成特化代码。本文设计了一种静态类型的高层中间表示(IR),将动态行为显式化,便于静态分析。该 IR 结合渐进类型与所有权跟踪,并显式表示 promise、多函数版本和上下文分派,从而直接支持特化、内联、作用域消除和拷贝消除等优化。作者形式化了核心演算 FIŘ,给出操作语义、类型系统以及流分析和反射分析,并证明了类型系统的可靠性。

问题
动态语言因动态类型、晚绑定、反射、写时复制和延迟求值等特性,使优化编译器难以生成高效代码;编译器需要推测动态行为并生成特化代码。
方法
设计静态类型的高层中间表示(IR),结合渐进类型与所有权跟踪,显式表示 promise、多函数版本和上下文分派,并形式化核心演算 FIŘ。
评估
以形式化方式评估:给出操作语义、类型系统以及流分析和反射分析,并证明类型系统的可靠性。
原文摘要(Abstract)

Dynamic programming languages pose significant challenges for optimizing compilers due to features such as dynamic typing, late binding, reflection, copy-on-write, and delayed evaluation. To generate efficient code, compilers must speculate on which dynamic features will be exercised and produce specialized code based on these assumptions. This article presents the design of a statically typed, high-level intermediate representation (IR) that makes dynamic behaviors explicit and amenable to static analysis. Our IR combines gradual typing with ownership tracking, and explicitly represents promises, multiple function versions, and contextual dispatch. Together, these features directly support optimizations such as specialization, inlining, scope elision, and copy elimination. We formalize a core calculus, called FIŘ, that captures the essential features required for these optimizations. We provide an operational semantics, a type system, and flow and reflection analyses, and we prove the soundness of the type system.

链接与引用

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

BibTeX
@article{LaurentHKKV26,
  title = {A Typed Intermediate Representation for Dynamic Languages},
  author = {Mickaël Laurent and Jakob Hain and Filip Křikava and Sebastián Krynski and Jan Vitek},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {48},
  number = {2},
  year = {2026},
  doi = {10.1145/3811921}
}