Initializing Global Objects: Time and Order
Fengyun Liu, Ondrej Lhoták, David Hua, Enze Xing
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Modular Reasoning about Global Variables and Their Initialization 引用了 A type-and-effect system for object initialization
- Modular Reasoning about Global Variables and Their Initialization 引用了 A conceptual framework for safe object initialization: a principled and mechanized soundness proof of the Celsius model
引用它的顶会 Paper1
它引用的 Paper2
- A type-and-effect system for object initializationFengyun Liu, Ondrej Lhoták, Aggelos Biboudis, Paolo G. Giarrusso 等OOPSLA 2020 · 8 次引用
- A conceptual framework for safe object initialization: a principled and mechanized soundness proof of the Celsius modelClement Blaudeau, Fengyun LiuOOPSLA 2022 · 2 次引用
相关 Paper
- ιDOT: a DOT calculus with object initializationIfaz Kabir, Yufeng Li, Ondrej LhotákOOPSLA 2020 · 3 次引用
- CiFi: Versatile Analysis of Class and Field ImmutabilityTobias Roth, Dominik Helm, Michael Reif, Mira MeziniASE 2021 · 7 次引用
- Modular Type Safety for Traits with Extensible Variants and Deep Pattern MatchingAndong Fan, Lionel Parreaux, Ningning XieOOPSLA 2026
- Taking Out the Toxic Trash: Recovering Precision in Mixed Flow-Sensitive Static AnalysesFabian Stemmler, Michael Schwarz, Julian Erhard, Sarah Tilscher 等PLDI 2025 · 3 次引用
- A practical mode system for recursive definitionsAlban Reynaud, Gabriel Scherer, Jeremy YallopPOPL 2021 · 2 次引用
