Graduality and Parametricity: Together Again for the First Time
Parametric polymorphism and gradual typing have proven to be a difficult combination, with no language yet produced that satisfies the fundamental theorems of each: parametricity and graduality. Notably, Toro, Labrada, and Tanter (POPL 2019) conjecture that for any gradual extension of System F that uses dynamic type generation, graduality and parametricity are “simply incompatible”. However, we argue that it is not graduality and parametricity that are incompatible per se, but instead that combining the syntax of System F with dynamic type generation as in previous work necessitates type-directed computation, which we show has been a common source of graduality and parametricity violations in previous work.
We then show that by modifying the syntax of universal and existential types to make the type name generation explicit, we remove the need for type-directed computation, and get a language that satisfies both graduality and parametricity theorems. The language has a simple runtime semantics, which can be explained by translation to a statically typed language where the dynamic type is interpreted as a dynamically extensible sum type. Far from being in conflict, we show that the parametricity theorem follows as a direct corollary of a relational interpretation of the graduality property.
Wed 22 Jan
|14:00 - 14:21|
Zeina MigeedUniversity of California, Los Angeles, Jens PalsbergUniversity of California, Los AngelesLink to publication DOI Media Attached File Attached
|14:21 - 14:43|
Max NewNortheastern University, Dustin JamnerNortheastern University, USA, Amal AhmedNortheastern University, USALink to publication DOI Media Attached
|14:43 - 15:05|
Lukas LazarekNorthwestern University, Alexis KingNorthwestern University, Samanvitha SundarNorthwestern University, Robby FindlerNorthwestern University, USA, Christos DimoulasPLT @ Northwestern UniversityLink to publication DOI Media Attached