paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Initializing Global Objects: Time and Order

初始化全局对象:时间与顺序
OOPSLA 7(OOPSLA2)2023匹配度 3/10 · 论文属于传统静态分析与抽象解释,关注全局对象初始化安全,但未涉及用户核心方向中的 LLM/Agent 交叉、浮点程序分析或贝叶斯程序分析;仅与广义程序分析有弱关联。引用 0 inbox
Fengyun Liu, Ondřej Lhoták, David Hua, Enze Xing
crossref: 2026-09-10

AI 速览

一句话:提出偏序与初始化时间无关性原则,用可模块化、可区域调优的静态分析保障全局对象安全初始化。

面向对象语言长期受 static 成员导致的初始化错误困扰,Scala 以全局对象替代 static,但全局对象初始化仍不安全,可能出现读取未初始化字段和死锁。论文提出偏序(partial ordering)与初始化时间无关性(initialization-time irrelevance)两条基本原则,并据此设计静态分析,在编译期消除全局对象初始化错误。该分析以对象为粒度模块化进行,避免全程序分析,同时支持全局对象初始化的静态调度,从而消除运行时开销。为增强可解释性与可调性,作者引入区域(region)概念,使上下文敏感性能被程序员理解并定制。摘要未报告具体实验评估。

问题
Scala 移除 static 成员并用全局对象统一对象模型后,全局对象初始化仍会产生读取未初始化字段和死锁等错误;如何安全初始化全局对象是未解决问题。
方法
论文提出偏序与初始化时间无关性两条基本原则,并据此设计对象粒度模块化静态分析,在编译期消除初始化错误、支持静态调度,并引入 region 使上下文敏感性可理解、可定制。
评估
摘要未报告具体实现或基准测试;作者以编译期消除初始化错误、避免全程序分析以及通过静态调度消除运行时开销来论证方法的有效性。
原文摘要(Abstract)

Object-oriented programming has been bothered by an awkward feature for a long time: static members . Static members not only compromise the conceptual integrity of object-oriented programming, but also give rise to subtle initialization errors, such as reading non-initialized fields and deadlocks. The Scala programming language eliminated static members from the language, replacing them with global objects that present a unified object-oriented programming model. However, the problem of global object initialization remains open, and programmers still suffer from initialization errors. We propose partial ordering and initialization-time irrelevance as two fundamental principles for initializing global objects. Based on these principles, we put forward an effective static analysis to ensure safe initialization of global objects, which eliminates initialization errors at compile time. The analysis also enables static scheduling of global object initialization to avoid runtime overhead. The analysis is modular at the granularity of objects and it avoids whole-program analysis. To make the analysis explainable and tunable, we introduce the concept of regions to make context-sensitivity understandable and customizable by programmers.

链接与引用

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

BibTeX
@article{paperbot1896,
  title = {Initializing Global Objects: Time and Order},
  author = {Fengyun Liu and Ondřej Lhoták and David Hua and Enze Xing},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622844}
}