skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Reusable

What is decidable about gradual types?

Published:20 December 2019Publication History
Skip Abstract Section

Abstract

Programmers can use gradual types to migrate programs to have more precise type annotations and thereby improve their readability, efficiency, and safety. Such migration requires an exploration of the migration space and can benefit from tool support, as shown in previous work. Our goal is to provide a foundation for better tool support by settling decidability questions about migration with gradual types. We present three algorithms and a hardness result for deciding key properties and we explain how they can be useful during an exploration. In particular, we show how to decide whether the migration space is finite, whether it has a top element, and whether it is a singleton. We also show that deciding whether it has a maximal element is NP-hard. Our implementation of our algorithms worked as expected on a suite of microbenchmarks.

Skip Supplemental Material Section

Supplemental Material

a29-migeed.webm

References

  1. Gavin Bierman, Martín Abadi, and Mads Torgersen. 2014. Understanding TypeScript. In ECOOP 2014 – Object-Oriented Programming, Richard Jones (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 257–281.Google ScholarGoogle Scholar
  2. John Peter Campora, Sheng Chen, Martin Erwig, and Eric Walkingshaw. 2018. Migrating Gradual Types. Proc. ACM Program. Lang. 2, POPL (2018), 15:1–15:29.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Giuseppe Castagna, Victor Lanvin, Tommaso Petrucciani, and Jeremy G. Siek. 2019. Gradual Typing: A New Perspective. Proc. ACM Program. Lang. 3, POPL, Article 16 (January 2019), 32 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Matteo Cimini and Jeremy Siek. 2016. The Gradualizer: A Methodology and Algorithm for Generating Gradual Type Systems. In Proceedings of POPL’16, ACM Symposium on Principles of Programming Languages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Ronald Garcia and Matteo Cimini. 2015. Principal Type Schemes for Gradual Programs. In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 303–315.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 429–442.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Paola Giannini and Simona Ronchi Della Rocca. 1988. Characterization of Typings in Polymorphic Type Discipline. In Proceedings of LICS’88, Third Annual Symposium on Logic in Computer Science. 61–70.Google ScholarGoogle ScholarCross RefCross Ref
  8. Mostafa Hassan, Caterina Urban, Marco Eilers, and Peter Müller. 2018. MaxSMT-Based Type Inference for Python 3. In Proceedings of CAV’18, Computer-Aided Verification.Google ScholarGoogle ScholarCross RefCross Ref
  9. Thomas S. Heinze, Anders Møller, and Fabio Strocco. 2016. Type Safety Analysis for Dart. In DLS.Google ScholarGoogle Scholar
  10. Nico Lehmann and Éric Tanter. 2017. Gradual Refinement Types. In Proceedings of POPL, ACM Symposium on Principles of Programming Languages.Google ScholarGoogle Scholar
  11. Yusuke Miyazaki, Taro Sekiyama, and Atsushi Igarashi. 2018. Dynamic Type Inference for Gradual Hindley-Milner Typing. CoRR abs/1810.12619 (2018). arXiv: 1810.12619 http://arxiv.org/abs/1810.12619Google ScholarGoogle Scholar
  12. Torben Æ. Mogensen. 1992. Efficient Self-Interpretations in Lambda Calculus. Journal of Functional Programming 2, 3 (1992), 345–363. See also DIKU Report D–128, Sep 2, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  13. Aseem Rastogi, Avik Chaudhuri, and Basil Hosmer. 2012. The Ins and Outs of Gradual Type Inference. SIGPLAN Not. 47, 1 (2012), 481–494.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jeremy Siek and Walid Taha. 2007. Gradual Typing for Objects. In Proceedings of the 21st European Conference on ObjectOriented Programming. 2–27.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Jeremy G. Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In IN SCHEME AND FUNCTIONAL PROGRAMMING WORKSHOP. 81–92.Google ScholarGoogle Scholar
  16. Jeremy G. Siek and Manish Vachharajani. 2008. Gradual Typing with Unification-based Inference. In Proceedings of the 2008 Symposium on Dynamic Languages. 7:1–7:12.Google ScholarGoogle Scholar
  17. Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015a. Refined Criteria for Gradual Typing. In SNAPL. 274–293.Google ScholarGoogle Scholar
  18. Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. 2015b. Monotonic References for Efficient Gradual Typing. In Proceedings of the 24th European Symposium on Programming on Programming Languages and Systems - Volume 9032. 432–456.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Sam Tobin-Hochstadt and Matthias Felleisen. 2008. The Design and Implementation of Typed Scheme. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’08). ACM, New York, NY, USA, 395–406. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Michael M. Vitousek, Andrew M. Kent, Jeremy G. Siek, and Jim Baker. 2014. Design and Evaluation of Gradual Typing for Python. SIGPLAN Not. 50, 2 (2014), 45–56.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Zhaogui Xu, Xiangyu Zhang, Lin Chen, Kexin Pei, and Baowen Xu. 2016. Python probabilistic type inference with natural language support. In Proceedings of 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE). 607–618.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. What is decidable about gradual types?

    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

    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!