Lune

OOPSLA2025顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper2

  1. Featherweight goRobert Griesemer, Raymond Hu, Wen Kokke, Julien Lange 等OOPSLA 2020 · 16 次引用
  2. Getting into the Flow: Towards Better Type Error Messages for Constraint-Based Type InferenceIshan Bhanuka, Lionel Parreaux, David Binder, Jonathan Immanuel BrachthäuserOOPSLA 2023 · 12 次引用

相关 Paper

  1. Better Defunctionalization through Lambda Set SpecializationWilliam Brandon, Benjamin Driscoll, Frank Dai, Wilson Berkow 等PLDI 2023 · 7 次引用
  2. Structural Subtyping as Parametric PolymorphismWenhao Tang, Daniel Hillerström, James McKinna, Michel Steuwer 等OOPSLA 2023 · 3 次引用
  3. An Order-Theoretic Analysis of Universe PolymorphismKuen-Bang Hou (Favonia), Carlo Angiuli, Reed MullanixPOPL 2023 · 4 次引用
  4. Mutually Iso-Recursive SubtypingAndreas RossbergOOPSLA 2023 · 8 次引用
  5. Parametric Subtyping for Structural Parametric PolymorphismHenry DeYoung, Andreia Mordido, Frank Pfenning, Ankush DasPOPL 2024 · 3 次引用
黄昏的海面,两侧是细线勾勒的悬崖