Gradual Typing: A New Perspective

被引:27
作者
Castagna, Giuseppe [1 ]
Lanvin, Victor [2 ]
Petrucciani, Tommaso [2 ,3 ]
Siek, Jeremy G. [4 ]
机构
[1] Univ Paris Diderot, CNRS, Paris, France
[2] Univ Paris Diderot, Paris, France
[3] Univ Genoa, Genoa, Italy
[4] Univ Indiana, Bloomington, IN USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2019年 / 3卷 / POPL期
基金
美国国家科学基金会;
关键词
Subtyping; Gradual Typing; Union Types; Intersection Types; Semantic Subtyping; Let-Polymorphism; Hindley-Milner;
D O I
10.1145/3290329
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We define a new, more semantic interpretation of gradual types and use it to "gradualize" two forms of polymorphism: subtyping polymorphism and implicit parametric polymorphism. In particular, we use the new interpretation to define three gradual type systems - Hindley-Milner, with subtyping, and with union and intersection types- in terms of two preorders, subtyping and materialization. These systems are defined both declaratively and algorithmically. The declarative presentation consists in adding two subsumption-like rules, one for each preorder, to the standard rules of each type system. This yields more intelligible and streamlined definitions and shows a direct correlation between cast insertion and materialization. For the algorithmic presentation, we show how it can be defined by reusing existing techniques such as unification and tallying.
引用
收藏
页数:32
相关论文
共 56 条
[1]   Blame for All [J].
Ahmed, Amal ;
Findler, Robert Bruce ;
Siek, Jeremy G. ;
Wadler, Philip .
POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, :201-214
[2]  
Ahmed Amal, 2017, INT C FUNCT PROGR IC
[3]  
Aiken A., 1993, FPCA '93. Conference on Functional Programming Languages and Computer Architecture, P31, DOI 10.1145/165180.165188
[4]  
Aiken A., 1994, Conference Record of POPL '94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, P163, DOI 10.1145/174675.177847
[5]  
Angelo Pedro, 2018, WORKSH INT TYP REL S WORKSH INT TYP REL S
[6]  
[Anonymous], 2006, Scheme and Functional Programming
[7]  
[Anonymous], 2005, Advanced Topics in Types and Programming Languages
[8]   Sound gradual typing: Only mostly dead [J].
Bauman, Spenser ;
Bolz-Tereick, Carl Friedrich ;
Siek, Jeremy ;
Tobin-Hochstadt, Sam .
Proceedings of the ACM on Programming Languages, 2017, 1 (OOPSLA)
[9]  
Bierman G, 2014, LECT NOTES COMPUT SC, V8586, P257
[10]  
Campora John Peter, 2017, P ACM PROGR LANG P ACM PROGR LANG, V15