Abstract
Abstract
C#, Dart, Pyret, Racket, TypeScript, VB: many recent languages integrate dynamic and static types via gradual typing. We systematically develop four calculi for gradual typing and the relations between them, building on and strengthening previous work. The calculi are as follows:
$\lambda{B}$
, based on the blame calculus of Wadler and Findler (2009);
$\lambda{C}$
, inspired by the coercion calculus of Henglein (1994);
$\lambda{S}$
inspired by the space-efficient calculus of Herman, Tomb, and Flanagan (2006); and
$\lambda{T}$
based on the threesome calculus of Siek and Wadler (2010). While
$\lambda{B}$
and
$\lambda{T}$
are little changed from previous work,
$\lambda{C}$
and
$\lambda{S}$
are new. Together,
$\lambda{B}$
,
$\lambda{C}$
,
$\lambda{S}$
, and
$\lambda{T}$
provide a coherent foundation for design, implementation, and optimization of gradual types. We define translations from
$\lambda{B}$
to
$\lambda{C}$
, from
$\lambda{C}$
to
$\lambda{S}$
, and from
$\lambda{S}$
to
$\lambda{T}$
. Much previous work lacked proofs of correctness or had weak correctness criteria; here we demonstrate the strongest correctness criterion one could hope for, that each of the translations is fully abstract. Each of the calculi reinforces the design of the others:
$\lambda{C}$
has a particularly simple definition, and the subtle definition of blame safety for
$\lambda{B}$
is justified by the simple definition of blame safety for
$\lambda{C}$
. Our calculus
$\lambda{S}$
is implementation-ready: the first space-efficient calculus that is both straightforward to implement and easy to understand. We give two applications: first, using full abstraction from
$\lambda{C}$
to
$\lambda{S}$
to establish an equational theory of coercions; and second, using full abstraction from
$\lambda{B}$
to
$\lambda{S}$
to easily establish the Fundamental Property of Casts, which required a custom bisimulation and six lemmas in earlier work.
Publisher
Cambridge University Press (CUP)
Reference74 articles.
1. Herman, D. , Tomb, A. & Flanagan, C. (2007) Space-efficient gradual typing. In Trends in Functional Programming (TFP).
2. Safe polymorphic type inference for a dynamically typed language
3. Richards, G. , Nardelli, F. Z. & Vitek, J. (2015) Concrete types for TypeScript. In European Conference on Object-Oriented Programming, ECOOP 2015. Springer-Verlag.
4. Flatt, M. & PLT (2014) The Racket Reference 6.0. Technical report, PLT. Available at: http://docs.racket-lang.org/reference/index.html
5. Benchmarks Replication for Toward Efficient Gradual Typing for Structural Types via Coercions
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Space-Efficient Polymorphic Gradual Typing, Mostly Parametric;Proceedings of the ACM on Programming Languages;2024-06-20
2. How Profilers Can Help Navigate Type Migration;Proceedings of the ACM on Programming Languages;2023-10-16
3. GTP Benchmarks for Gradual Typing Performance;Proceedings of the 2023 ACM Conference on Reproducibility and Replicability;2023-06-27