The Simple Essence of Monomorphization
Matthew Lutze, Philipp Schuster, Jonathan Immanuel Brachthäuser
摘要
Monomorphization is a common implementation technique for parametric type-polymorphism, which avoids the potential runtime overhead of uniform representations at the cost of code duplication. While important as a folklore implementation technique, there is a lack of general formal treatments in the published literature. Moreover, it is commonly believed to be incompatible with higher-rank polymorphism. In this paper, we formally present a simple monomorphization technique based on a type-based flow analysis that generalizes to programs with higher-rank types, existential types, and arbitrary combinations. Inspired by algebraic subtyping, we track the flow of type instantiations through the program. Our approach only supports monomorphization up to polymorphic recursion, which we uniformly detect as cyclic flow. Treating universal and existential quantification uniformly, we identify a novel form of polymorphic recursion in the presence of existential types, which we coin polymorphic packing. We study the meta-theory of our approach, showing that our translation is type-preserving and preserves semantics step-wise.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper2
相关 Paper
- Better Defunctionalization through Lambda Set SpecializationWilliam Brandon, Benjamin Driscoll, Frank Dai, Wilson Berkow 等PLDI 2023 · 被引用 7 次
- Structural Subtyping as Parametric PolymorphismWenhao Tang, Daniel Hillerström, James McKinna, Michel Steuwer 等OOPSLA 2023 · 被引用 3 次
- An Order-Theoretic Analysis of Universe PolymorphismKuen-Bang Hou (Favonia), Carlo Angiuli, Reed MullanixPOPL 2023 · 被引用 4 次
- Mutually Iso-Recursive SubtypingAndreas RossbergOOPSLA 2023 · 被引用 8 次
- Parametric Subtyping for Structural Parametric PolymorphismHenry DeYoung, Andreia Mordido, Frank Pfenning, Ankush DasPOPL 2024 · 被引用 3 次
