DeepAI
Log In Sign Up

Gradual Parametricity, Revisited (with Appendix)

07/12/2018
by   Matías Toro, et al.
0

Bringing the benefits of gradual typing to a language with parametric polymorphism like System F, while preserving relational parametricity, has proven extremely challenging: first attempts were formulated a decade ago, and several designs were recently proposed. Among other issues, these proposals can however signal parametricity errors in unexpected situations, and improperly handle type instantiations when imprecise types are involved. These observations further suggest that existing polymorphic cast calculi are not well suited for supporting a gradual counterpart of System F. Consequently, we revisit the challenge of designing a gradual language with explicit parametric polymorphism, exploring the extent to which the Abstracting Gradual Typing methodology helps us derive such a language, GSF. We present the design and metatheory of GSF. In addition to avoiding the uncovered semantic issues, GSF satisfies all the expected properties of a gradual parametric language, save for one property: the dynamic gradual guarantee, which was left as conjecture in all prior work, is here proven to be simply incompatible with parametricity. We nevertheless establish a weaker property that allows us to disprove several claims about gradual free theorems, clarifying the kind of reasoning supported by gradual parametricity.

READ FULL TEXT
07/12/2018

Gradual Parametricity, Revisited

Bringing the benefits of gradual typing to a language with parametric po...
01/13/2021

Parametricity for Nested Types and GADTs

This paper considers parametricity and its consequent free theorems for ...
09/15/2021

Dala: A Simple Capability-Based Dynamic Language Design For Data Race-Freedom

Dynamic languages like Erlang, Clojure, JavaScript, and E adopted data-r...
11/06/2018

Gradual Type Theory (Extended Version)

Gradually typed languages are designed to support both dynamically typed...
08/21/2019

Free Theorems Simply, via Dinaturality

Free theorems are a popular tool in reasoning about parametrically polym...
01/30/2020

Toward a Mechanized Compendium of Gradual Typing

The research on gradual typing has grown considerably over the last deca...
09/11/2020

Internalizing Representation Independence with Univalence

In their usual form, representation independence metatheorems provide an...