skip to main content
research-article
Open Access

Abstracting gradual typing moving forward: precise and space-efficient

Published:04 January 2021Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Felipe Bañados Schwerter. 2020. Coquihalla/agt-moving-forward: Supporting Artifacts from POPL '21 submission. https: //doi.org/10.5281/zenodo.4111019 Google ScholarGoogle ScholarCross RefCross Ref
  3. 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 ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Tim Disney and Cormac Flanagan. 2011. Gradual information flow typing. https://users.soe.ucsc.edu/~cormac/papers/ stop11.pdfGoogle ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. James R. Munkres. 2000. Topology: Second Edition. Prentice Hall, Upper Saddle River, NJ.Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Benjamin C. Pierce. 2002. Types and programming languages. MIT Press, Cambridge, MA, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. Davide Sangiorgi. 2011. Introduction to Bisimulation and Coinduction. Cambridge University Press, New York, NY, USA.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarCross RefCross Ref
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarCross RefCross Ref
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Abstracting gradual typing moving forward: precise and space-efficient

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image Proceedings of the ACM on Programming Languages
          Proceedings of the ACM on Programming Languages  Volume 5, Issue POPL
          January 2021
          1789 pages
          EISSN:2475-1421
          DOI:10.1145/3445980
          Issue’s Table of Contents

          Copyright © 2021 Owner/Author

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 4 January 2021
          Published in pacmpl Volume 5, Issue POPL

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!