The Simple Essence of Monomorphization
summary
Presents a type-flow directed monomorphization that duplicates declarations by collecting type-flow constraints, solving them with a fixed-point graph algorithm, and specializing code; it handles higher-rank and existential types and yields a type-preserving, stepwise semantics-preserving translation. Polymorphic recursion shows up as growing cycles (infinite solutions) and is rejected; a novel failure mode for existentials is named polymorphic packing. Implementation and reusable artifacts are provided, but the approach forbids separate compilation.
AI-written summary · about
chapters (12)
- 0:00Monomorphization problem
- 1:06Basic monomorphization examples
- 3:16Type-flow directed monomorphization
- 5:23Higher rank types handling
- 7:29Polymorphic recursion limits
- 9:15Growing cycles in constraints
- 9:56Implementation and results
- 10:39Q&A: constraint solver
- 11:43Q&A: related work
- 12:04Q&A: recursion approaches
- 12:46Q&A: whole-program limits
- 13:27Closing remarks
related talks
15mMonadification of Attribute Grammars
23mBetter Defunctionalization through Lambda Set Specialization
21mSeamless Scope-Safe Metaprogramming Through Polymorphic Subtype Inference (Short Paper)
21mPolymorphic Type Inference for Dynamic Languages
24mExistentialize your Generics
23mGeneric Go to Go: Dictionary-Passing, Monomorphisation, and Hybrid
25mRecursive Program Synthesis using Paramorphisms
24mAll for one and none forall: Compiling polymorphic relations without(…)
