Abstracting Gradual Typing

被引:0
作者
Garcia R. [1 ]
Clark A.M. [1 ]
Tanter E. [2 ]
机构
[1] Software Practices Lab., Department of Computer Science, University of British Columbia
[2] PLEIAD Laboratory, Computer Science Department (DCC), University of Chile
来源
ACM SIGPLAN Notices | 2016年 / 51卷 / 01期
基金
加拿大自然科学与工程研究理事会;
关键词
Abstract interpretation; Gradual typing; Subtyping;
D O I
10.1145/2837614.2837670
中图分类号
学科分类号
摘要
Language researchers and designers have extended a wide variety of type systems to support gradual typing, which enables languages to seamlessly combine dynamic and static checking. These efforts consistently demonstrate that designing a satisfactory gradual counterpart to a static type system is challenging, and this challenge only increases with the sophistication of the type system. Gradual type system designers need more formal tools to help them conceptualize, structure, and evaluate their designs. In this paper, we propose a new formal foundation for gradual typing, drawing on principles from abstract interpretation to give gradual types a semantics in terms of pre-existing static types. Abstracting Gradual Typing (AGT for short) yields a formal account of consistency-one of the cornerstones of the gradual typing approach-that subsumes existing notions of consistency, which were developed through intuition and ad hoc reasoning. Given a syntax-directed static typing judgment, the AGT approach induces a corresponding gradual typing judgment. Then the type safety proof for the underlying static discipline induces a dynamic semantics for gradual programs defined over sourcelanguage typing derivations. The AGT approach does not resort to an externally justified cast calculus: instead, run-time checks naturally arise by deducing evidence for consistent judgments during proof reduction. To illustrate the approach, we develop a novel gradually-typed counterpart for a language with record subtyping. Gradual languages designed with the AGT approach satisfy by construction the refined criteria for gradual typing set forth by Siek and colleagues. © 2016 ACM.
引用
收藏
页码:429 / 442
页数:13
相关论文
共 38 条
  • [31] Siek J.G., Vitousek M.M., Cimini M., Boyland J.T., Refined criteria for gradual typing, 1st Summit on Advances in Programming Languages (SNAPL 2015), pp. 274-293, (2015)
  • [32] Siek J.G., Vitousek M.M., Cimini M., Tobin-Hochstadt S., Garcia R., Monotonic references for efficient gradual typing, 24th European Symposium on Programming Languages and Systems (ESOP 2015), pp. 432-456, (2015)
  • [33] Swamy N., Fournet C., Rastogi A., Bhargavan K., Chen J., Strub P.-Y., Bierman G., Gradual typing embedded securely in JavaScript, 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2014), pp. 425-437, (2014)
  • [34] Takikawa A., Strickland T., Dimoulas C., Tobin-Hochstadt S., Felleisen M., Gradual typing for first-class classes, 27th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2012), pp. 793-810, (2012)
  • [35] Thatte S., Quasi-static typing, 17th ACM Symposium on Principles of Programming Languages (POPL 90), pp. 367-381, (1990)
  • [36] Toro M., Tanter E., Customizable gradual polymorphic effects for Scala, 30th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2015), pp. 935-953, (2015)
  • [37] Wadler P., Findler R.B., Well-typed programs can't be blamed, 18th European Symposium on Programming Languages and Systems (ESOP 2009), pp. 1-16, (2009)
  • [38] Wolff R., Garcia R., Tanter E., Aldrich J., Gradual typestate, 25th European Conference on Object-oriented Programming (ECOOP 2011), pp. 459-483, (2011)