Affiliation:
1. Kyoto University, Kyoto, Japan
2. National Institute of Informatics, Tokyo, Japan / SOKENDAI, Tokyo, Japan
3. Tokyo Institute of Technology, Tokyo, Japan
Abstract
Since the arrival of gradual typing, which allows partially typed code in a single program, efficient implementations of gradual typing have been an active research topic. In this paper, we study the space-efficiency problem of gradual typing in the presence of parametric polymorphism. Based on the existing work that showed the impossibility of a space-efficient implementation that supports fully parametric polymorphism, this paper will show that a space-efficient implementation is, in principle, possible by slightly relaxing parametricity. We first develop λC
mp
, which is a coercion calculus with mostly parametric polymorphism, and show its relaxed parametricity. Then, we present λS
mp
, a space-efficient version of λC
mp
, and prove that λS
mp
programs can be executed in a space-efficient manner and that translation from λC
mp
to λS
mp
is type- and semantics-preserving.
Funder
Japan Society for the Promotion of Science
Publisher
Association for Computing Machinery (ACM)