Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Abstracting gradual typing moving forward: precise and space-efficient

Published: 04 January 2021 Publication History

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
[2]
Felipe Bañados Schwerter. 2020. Coquihalla/agt-moving-forward: Supporting Artifacts from POPL '21 submission. https: //doi.org/10.5281/zenodo.4111019
[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]
[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
[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
[6]
Tim Disney and Cormac Flanagan. 2011. Gradual information flow typing. https://users.soe.ucsc.edu/~cormac/papers/ stop11.pdf
[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
[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
[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. 718288
[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
[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
[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
[13]
James R. Munkres. 2000. Topology: Second Edition. Prentice Hall, Upper Saddle River, NJ.
[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
[15]
Benjamin C. Pierce. 2002. Types and programming languages. MIT Press, Cambridge, MA, USA.
[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
[17]
Davide Sangiorgi. 2011. Introduction to Bisimulation and Coinduction. Cambridge University Press, New York, NY, USA.
[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
[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
[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
[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.pdf
[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
[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
[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
[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
[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
[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
[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
[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

Cited By

View all
  • (2024)Merging Gradual TypingProceedings of the ACM on Programming Languages10.1145/36897348:OOPSLA2(648-676)Online publication date: 8-Oct-2024
  • (2024)Space-Efficient Polymorphic Gradual Typing, Mostly ParametricProceedings of the ACM on Programming Languages10.1145/36564418:PLDI(1585-1608)Online publication date: 20-Jun-2024
  • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 January 2021
Published in PACMPL Volume 5, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. abstract interpretation
  2. cast calculi
  3. gradual typing
  4. subtyping

Qualifiers

  • Research-article

Funding Sources

  • National Sciences and Engineering Research Council of Canada

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)190
  • Downloads (Last 6 weeks)29
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Merging Gradual TypingProceedings of the ACM on Programming Languages10.1145/36897348:OOPSLA2(648-676)Online publication date: 8-Oct-2024
  • (2024)Space-Efficient Polymorphic Gradual Typing, Mostly ParametricProceedings of the ACM on Programming Languages10.1145/36564418:PLDI(1585-1608)Online publication date: 20-Jun-2024
  • (2024)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-2024
  • (2024)Type-directed operational semantics for gradual typingJournal of Functional Programming10.1017/S095679682400007834Online publication date: 26-Sep-2024
  • (2023)GTP Benchmarks for Gradual Typing PerformanceProceedings of the 2023 ACM Conference on Reproducibility and Replicability10.1145/3589806.3600034(102-114)Online publication date: 27-Jun-2023
  • (2022)Propositional equality for gradual dependently typed programmingProceedings of the ACM on Programming Languages10.1145/35476276:ICFP(165-193)Online publication date: 31-Aug-2022
  • (2022)Gradualizing the Calculus of Inductive ConstructionsACM Transactions on Programming Languages and Systems10.1145/349552844:2(1-82)Online publication date: 30-Jun-2022
  • (2021)Gradually structured dataProceedings of the ACM on Programming Languages10.1145/34855035:OOPSLA(1-29)Online publication date: 15-Oct-2021
  • (2021)Mechanized Type Safety for Gradual Information Flow2021 IEEE Security and Privacy Workshops (SPW)10.1109/SPW53761.2021.00033(194-206)Online publication date: May-2021
  • (2021)Parameterized cast calculi and reusable meta-theory for gradually typed lambda calculiJournal of Functional Programming10.1017/S095679682100024131Online publication date: 11-Nov-2021

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media