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

Sound gradual typing is nominally alive and well

Published:12 October 2017Publication History
Skip Abstract Section

Abstract

Recent research has identified significant performance hurdles that sound gradual typing needs to overcome. These performance hurdles stem from the fact that the run-time checks gradual type systems insert into code can cause significant overhead. We propose that designing a type system for a gradually typed language hand in hand with its implementation from scratch is a possible way around these and several other hurdles on the way to efficient sound gradual typing. Such a design process also highlights the type-system restrictions required for efficient composition with gradual typing. We formalize the core of a nominal object-oriented language that fulfills a variety of desirable properties for gradually typed languages, and present evidence that an implementation of this language suffers minimal overhead even in adversarial benchmarks identified in earlier work.

Skip Supplemental Material Section

Supplemental Material

References

  1. Amal Ahmed, Robert Bruce Findler, Jeremy G. Siek, and Philip Wadler. 2011. Blame for All . In POPL 2011. ACM, New York, NY, USA, 201–214. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Wonsun Ahn, Jiho Choi, Thomas Shull, María J. Garzarán, and Josep Torrellas. 2014. Improving JavaScript Performance by Deconstructing the Type System . In PLDI 2014. ACM, New York, NY, USA, 496–507. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Esteban Allende, Oscar Callaú, Johan Fabry, Éric Tanter, and Marcus Denker. 2014. Gradual Typing for Smalltalk . Science of Computer Programming 96 (2014), 52 – 69. Special issue on Advances in Smalltalk based Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Esteban Allende, Johan Fabry, and Éric Tanter. 2013. Cast Insertion Strategies for Gradually-Typed Objects . In DLS 2013. ACM, New York, NY, USA, 27–36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Nada Amin and Ross Tate. 2016. Java and Scala’s Type Systems are Unsound: The Existential Crisis of Null Pointers . In OOPSLA 2016. ACM, New York, NY, USA, 838–848. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Christopher Anderson and Sophia Drossopoulou. 2003. BabyJ: From Object Based to Class Based Programming via Types . In WOOD 2003. Elsevier Science Publishers B. V., Amsterdam, The Netherlands, 53 – 81. Google ScholarGoogle ScholarCross RefCross Ref
  7. Gavin Bierman, Erik Meijer, and Mads Torgersen. 2010. Adding Dynamic Types to C# . In ECOOP 2010. Springer Berlin Heidelberg, Berlin, Heidelberg, 76–100. Google ScholarGoogle ScholarCross RefCross Ref
  8. Gilad Bracha. 2004. Pluggable Type Systems . (2004). In Workshop on Revival of Dynamic Languages.Google ScholarGoogle Scholar
  9. Matteo Cimini and Jeremy G. Siek. 2016. The Gradualizer: A Methodology and Algorithm for Generating Gradual Type Systems . In POPL 2016. ACM, New York, NY, USA, 443–455. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Alan Demers, Mark Weiser, Barry Hayes, Hans Boehm, Daniel Bobrow, and Scott Shenker. 1990. Combining Generational and Conservative Garbage Collection: Framework and Implementations . In POPL 1990. ACM, New York, NY, USA, 261–269. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Peter Deutsch and Allan M. Schiffman. 1984. Efficient Implementation of the Smalltalk-80 System . In POPL 1984. ACM, New York, NY, USA, 297–302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Facebook, Inc. 2016. The Hack Language Specification, Version 1.1 . (April 2016).Google ScholarGoogle Scholar
  13. Robert Bruce Findler and Matthias Felleisen. 2002. Contracts for Higher-Order Functions . In ICFP 2002. ACM, New York, NY, USA, 48–59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing . In POPL 2016. ACM, New York, NY, USA, 429–442. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ben Greenman, Fabian Muehlboeck, and Ross Tate. 2014. Getting F-Bounded Polymorphism into Shape . In PLDI 2014. ACM, New York, NY, USA, 89–99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Radu Grigore. 2017. Java Generics are Turing Complete . In POPL 2017. ACM, New York, NY, USA, 73–85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jessica Gronski, Kenneth Knowles, Aaron Tomb, Stephen N. Freund, and Cormac Flanagan. 2006. SAGE: Hybrid Checking for Flexible Specifications . Scheme and Functional Programming Workshop 6 (2006), 93–104.Google ScholarGoogle Scholar
  18. Fritz Henglein. 1994. Dynamic Typing: Syntax and Proof Theory . Science of Computer Programming 22, 3 (1994), 197 – 230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. 2001. Featherweight Java: A Minimal Core Calculus for Java and GJ . TOPLAS 23, 3 (May 2001), 396–450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lintaro Ina and Atsushi Igarashi. 2011. Gradual Typing for Generics . In OOPSLA 2011. ACM, New York, NY, USA, 609–624. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Andrew Kennedy and Benjamin C. Pierce. 2007. On Decidability of Nominal Subtyping with Variance . In FOOL/WOOD 2007. Microsoft Research, Cambridge, UK, 1–12.Google ScholarGoogle Scholar
  22. Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-Language Programs . In POPL 2007. ACM, New York, NY, USA, 3–10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Microsoft. 2012. TypeScript . (Oct. 2012).Google ScholarGoogle Scholar
  24. The Python Development Team. 2008. Python Benchmarks . https://hg.python.org/benchmarks/ . (Dec. 2008).Google ScholarGoogle Scholar
  25. Aseem Rastogi, Nikhil Swamy, Cédric Fournet, Gavin Bierman, and Panagiotis Vekris. 2015. Safe & Efficient Gradual Typing for TypeScript . In POPL 2015. ACM, New York, NY, USA, 167–180. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Gregor Richards, Francesco Zappa Nardelli, and Jan Vitek. 2015. Concrete Types for TypeScript . In ECOOP 2015, Vol. 37. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 76–100.Google ScholarGoogle Scholar
  27. Michel Schinz. 2005. Compiling Scala for the Java Virtual Machine . Ph.D. Dissertation. EPFL.Google ScholarGoogle Scholar
  28. Jeremy Siek, Ronald Garcia, and Walid Taha. 2009. Exploring the Design Space of Higher-Order Casts . In ESOP 2009. Springer-Verlag, Berlin, Heidelberg, 17–31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Jeremy Siek and Walid Taha. 2007. Gradual Typing for Objects . In ECOOP 2007. Springer-Verlag, Berlin, Heidelberg, 2–27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Jeremy G Siek and Walid Taha. 2006. Gradual Typing for Functional Languages . Scheme and Functional Programming Workshop 6 (2006), 81–92.Google ScholarGoogle Scholar
  31. Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015a. Refined Criteria for Gradual Typing . In SNAPL 2015, Vol. 32. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 274–293.Google ScholarGoogle Scholar
  32. Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, Sam Tobin-Hochstadt, and Ronald Garcia. 2015b. Monotonic References for Efficient Gradual Typing . In ESOP 2015. Springer Berlin Heidelberg, Berlin, Heidelberg, 432–456. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Jeremy G. Siek and Philip Wadler. 2010. Threesomes, with and without Blame . In POPL 2010. ACM, New York, NY, USA, 365–376. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Daniel Smith and Robert Cartwright. 2008. Java Type Inference is Broken: Can We Fix It? . In OOPSLA 2008. ACM, New York, NY, USA, 505–524. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Nikhil Swamy, Cedric Fournet, Aseem Rastogi, Karthikeyan Bhargavan, Juan Chen, Pierre-Yves Strub, and Gavin Bierman. 2014. Gradual Typing Embedded Securely in JavaScript . In POPL 2014. ACM, New York, NY, USA, 425–437. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Asumu Takikawa, Daniel Feltey, Ben Greenman, Max S. New, Jan Vitek, and Matthias Felleisen. 2016. Is Sound Gradual Typing Dead? . In POPL 2016. ACM, New York, NY, USA, 456–468. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Sam Tobin-Hochstadt and Matthias Felleisen. 2006. Interlanguage Migration: From Scripts to Programs . In OOPSLA 2006. ACM, New York, NY, USA, 964–974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Matías Toro and Éric Tanter. 2017. A Gradual Interpretation of Union Types . In SAS 2017. Springer International Publishing, Cham, 382–404. Google ScholarGoogle ScholarCross RefCross Ref
  39. Michael M. Vitousek, Andrew M. Kent, Jeremy G. Siek, and Jim Baker. 2014. Design and Evaluation of Gradual Typing for Python . In DLS 2014. ACM, New York, NY, USA, 45–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Michael M. Vitousek, Cameron Swords, and Jeremy G. Siek. 2017. Big Types in Little Runtime: Open-World Soundness and Collaborative Blame for Gradual Type Systems . In POPL 2017. ACM, New York, NY, USA, 762–774. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can’t Be Blamed . In ESOP 2009. Springer Berlin Heidelberg, Berlin, Heidelberg, 1–16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. 2010. Integrating Typed and Untyped Code in a Scripting Language . In POPL 2010. ACM, New York, NY, USA, 377–388. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sound gradual typing is nominally alive and well

          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 1, Issue OOPSLA
            October 2017
            1786 pages
            EISSN:2475-1421
            DOI:10.1145/3152284
            Issue’s Table of Contents

            Copyright © 2017 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 12 October 2017
            Published in pacmpl Volume 1, Issue OOPSLA

            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