Abstract
Abstracting Gradual Typing (AGT) is a systematic approach to designing gradually-typed languages. Languages developed using AGT automatically satisfy the formal semantic criteria for gradual languages identified by Siek et al. Nonetheless, vanilla AGT semantics can still have important shortcomings. First, a gradual language's runtime checks should preserve the space-efficiency guarantees inherent to the underlying static and dynamic languages. To the contrary, the default operational semantics of AGT break proper tail calls. Second, a gradual language's runtime checks should enforce basic modular type-based invariants expected from the static type discipline. To the contrary, the default operational semantics of AGT may fail to enforce some invariants in surprising ways. We demonstrate this in the GTFL≲ language of Garcia et al.
This paper addresses both problems at once by refining the theory underlying AGT's dynamic checks. Garcia et al. observe that AGT involves two abstractions of static types: one for the static semantics and one for the dynamic semantics. We recast the latter as an abstract interpretation of subtyping itself, while gradual types still abstract static types. Then we show how forward-completeness (Giacobazzi and Quintarelli) is key to supporting both space-efficient execution and reliable runtime type enforcement.
- Amal Ahmed, Dustin Jamner, Jeremy G. Siek, and Philip Wadler. 2017. Theorems for Free for Free: Parametricity, with and without Types. Proc. ACM Program. Lang. 1, ICFP, Article 39 ( Aug. 2017 ), 28 pages. https://doi.org/10.1145/3110283 Google Scholar
Digital Library
- Felipe Bañados Schwerter. 2020. Coquihalla/agt-moving-forward: Supporting Artifacts from POPL '21 submission. https: //doi.org/10.5281/zenodo.4111019 Google Scholar
Cross Ref
- Felipe Bañados Schwerter, Alison M. Clark, Khurram A. Jafery, and Ronald Garcia. 2020. Abstracting Gradual Typing Moving Forward: Precise and Space-Eficient (Technical Report). arXiv: 2010. 14094 [cs.PL]Google Scholar
- Felipe Bañados Schwerter, Ronald Garcia, and Éric Tanter. 2014. A Theory of Gradual Efect Systems. In 19th ACM SIGPLAN Conference on Functional Programming (ICFP 2014 ). ACM Press, Gothenburg, Sweden, 283-295. https://doi.org/10.1145/ 2628136.2628149 Google Scholar
Digital Library
- Patrick Cousot and Radhia Cousot. 1977. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In POPL. ACM Press, Los Angeles, CA, USA, 238-252. https://doi.org/10. 1145/512950.512973 Google Scholar
Digital Library
- Tim Disney and Cormac Flanagan. 2011. Gradual information flow typing. https://users.soe.ucsc.edu/~cormac/papers/ stop11.pdfGoogle Scholar
- Ronald Garcia and Matteo Cimini. 2015. Principal Type Schemes for Gradual Programs. In 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2015 ). ACM Press, New York, NY, USA, 303-315. https: //doi.org/10.1145/2676726.2676992 Google Scholar
Digital Library
- Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing. In 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (St Petersburg, FL, USA). ACM Press, New York, NY, USA, 429-442. https://doi.org/10.1145/2837614.2837670 Google Scholar
Digital Library
- Roberto Giacobazzi and Elisa Quintarelli. 2001. Incompleteness, Counterexamples, and Refinements in Abstract ModelChecking. In Proceedings of the 8th International Symposium on Static Analysis (SAS '01). Springer-Verlag, London, UK, UK, 356-373. http://dl.acm.org/citation.cfm?id= 647170. 718288Google Scholar
Digital Library
- Fritz Henglein. 1994. Dynamic typing: syntax and proof theory. Science of Computer Programming 22, 3 ( June 1994 ), 197-230. https://doi.org/10.1016/ 0167-6423 ( 94 ) 00004-2 Google Scholar
Digital Library
- David Herman, Aaron Tomb, and Cormac Flanagan. 2010. Space-eficient Gradual Typing. Higher Order Symbol. Comput. 23, 2 ( June 2010 ), 167-189. https://doi.org/10.1007/s10990-011-9066-z Google Scholar
Digital Library
- Lintaro Ina and Atsushi Igarashi. 2011. Gradual typing for generics. In 26th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2011 ). ACM Press, New York, NY, USA, 609-624. https: //doi.org/10.1145/2048066.2048114 Google Scholar
Digital Library
- James R. Munkres. 2000. Topology: Second Edition. Prentice Hall, Upper Saddle River, NJ.Google Scholar
- Max S. New, Dustin Jamner, and Amal Ahmed. 2019. Graduality and Parametricity: Together Again for the First Time. Proc. ACM Program. Lang. 4, POPL, Article 46 ( Dec. 2019 ), 32 pages. https://doi.org/10.1145/3371114 Google Scholar
Digital Library
- Benjamin C. Pierce. 2002. Types and programming languages. MIT Press, Cambridge, MA, USA.Google Scholar
Digital Library
- D. Rémy. 1989. Type Checking Records and Variants in a Natural Extension of ML. In POPL (Austin, Texas, USA). ACM, New York, NY, USA, 77-88. https://doi.org/10.1145/75277.75284 Google Scholar
Digital Library
- Davide Sangiorgi. 2011. Introduction to Bisimulation and Coinduction. Cambridge University Press, New York, NY, USA.Google Scholar
- Ilya Sergey and Dave Clarke. 2012. Gradual Ownership Types. In Proc. European Symposium on Programming Languages and Systems (ESOP '12, Vol. 7211 ), Helmut Seidl (Ed.). Springer-Verlag, Tallinn, Estonia, 579-599. https://doi.org/10.1007/978-3-642-28869-2_29 Google Scholar
Digital Library
- Jeremy Siek and Walid Taha. 2007. Gradual typing for objects. In Proc. European Conference on Object-oriented Programming (ECOOP '07, 4609 ), Erik Ernst (Ed.). Springer-Verlag, Berlin, Germany, 2-27. https://doi.org/10.1007/978-3-540-73589-2_2 Google Scholar
Digital Library
- Jeremy Siek and Philip Wadler. 2010. Threesomes, with and without blame. In Proc. Symposium on Principles of Programming Languages (Madrid, Spain) (POPL '10). ACM, New York, NY, USA, 365-376. https://doi.org/10.1145/1570506.1570511 Google Scholar
Digital Library
- Jeremy G. Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In Proc. Scheme and Functional Programming Workshop. University of Chicago Technical Report, Chicago, IL, USA, 81-92. http://scheme2006.cs.uchicago.edu/ scheme2006.pdfGoogle Scholar
- Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015. Refined Criteria for Gradual Typing. In SNAPL. Schloss Dagstuhl, Asilomar, California, USA, 274-293. https://doi.org/10.4230/LIPIcs.SNAPL. 2015.274 Google Scholar
Cross Ref
- Sam Tobin-Hochstadt and Matthias Felleisen. 2006. Interlanguage Migration: From Scripts to Programs. In OOPSLA. ACM, New York, NY, USA, 964-974. https://doi.org/10.1145/1176617.1176755 Google Scholar
Digital Library
- Matías Toro, Ronald Garcia, and Éric Tanter. 2018. Type-Driven Gradual Security with References. ACM Transactions on Programming Languages and Systems 40, 4, Article 16 ( Dec. 2018 ), 55 pages. https://doi.org/10.1145/3229061 Google Scholar
Digital Library
- Matías Toro, Elizabeth Labrada, and Éric Tanter. 2019. Gradual Parametricity, Revisited. Proc. ACM Program. Lang. 3, POPL, Article 17 ( Jan. 2019 ), 30 pages. https://doi.org/10.1145/3290330 Google Scholar
Digital Library
- Matías Toro and Éric Tanter. 2020. Abstracting gradual references. Science of Computer Programming 197 ( 2020 ), 102496. https://doi.org/10.1016/j.scico. 2020.102496 Google Scholar
Cross Ref
- Preston Tunnell Wilson, Ben Greenman, Justin Pombrio, and Shriram Krishnamurthi. 2018. The Behavior of Gradual Types: A User Study. In DLS (Boston, MA, USA). ACM, New York, NY, USA, 1-12. https://doi.org/10.1145/3276945.3276947 Google Scholar
Digital Library
- Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can't Be Blamed. In Proc. European Symposium on Programming Languages (York, UK) (ESOP '09). Springer-Verlag, Berlin, 1-16. https://doi.org/10.1007/978-3-642-00590-9_1 Google Scholar
Digital Library
- Andrew K. Wright and Matthias Felleisen. 1994. A Syntactic Approach to Type Soundness. Information and Computation 115, 1 (Nov. 1994 ), 38-94. https://doi.org/10.1006/inco. 1994.1093 Google Scholar
Digital Library
Index Terms
Abstracting gradual typing moving forward: precise and space-efficient
Recommendations
Abstracting gradual typing
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesLanguage 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 ...
Abstracting gradual typing
POPL '16Language 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 typing: a new perspective
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 ...






Comments