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

A spectrum of type soundness and performance

Published:30 July 2018Publication History
Skip Abstract Section

Abstract

The literature on gradual typing presents three fundamentally different ways of thinking about the integrity of programs that combine statically typed and dynamically typed code. This paper presents a uniform semantic framework that explains all three approaches, illustrates how each approach affects a developer's work, and adds a systematic performance comparison for a single implementation platform.

Skip Supplemental Material Section

Supplemental Material

a71-greenman.webm

References

  1. Martin Abadi, Luca Cardelli, Benjamin C. Pierce, and Gordon D. Plotkin. Dynamic Typing in a Statically Typed Language. Transactions on Programming Languages and Systems 13(2), pp. 237–268, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amal Ahmed, Robert Bruce Findler, Jeremy G. Siek, and Philip Wadler. Blame for All. Symposium on Principles of Programming Languages, pp. 201–214, 2011.Google ScholarGoogle Scholar
  3. Alexander Aiken, Edward L. Wimmers, and T.K. Lakshman. Soft Typing with Conditional Types. Symposium on Principles of Programming Languages, pp. 163–173, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Esteban Allende, Oscar Callaú, Johan Fabry, Éric Tanter, and Marcus Denker. Gradual typing for Smalltalk. Science of Computer Programming 96(1), pp. 52–69, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Esteban Allende, Johan Fabry, Ronald Garcia, and Éric Tanter. Confined Gradual Typing. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 251–270, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Esteban Allende, Johan Fabry, and Éric Tanter. Cast Insertion Strategies for Gradually-Typed Objects. Dynamic Languages Symposium, pp. 27–36, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christopher Anderson, Paola Giannini, and Sophia Drossopoulou. Towards Type Inference for JavaScript. European Conference on Object-Oriented Programming, pp. 428–452, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Henk Barendregt. The Lambda Calculus: Its Syntax and Semantics. North-Holland Publishing Company, 1981.Google ScholarGoogle Scholar
  9. Gilles Barthe. Implicit Coercions in Type Systems. International Workshop on Types for Proofs and Programs, pp. 1–15, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Spenser Bauman, Carl Friedrich Bolz, Robert Hirschfield, Vasily Kirilichev, Tobias Pape, Jeremy G. Siek, and Sam TobinHochstadt. Pycket: A Tracing JIT For a Functional Language. International Conference on Functional Programming, pp. 22–34, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Spenser Bauman, Carl Friedrich Bolz-Tereick, Jeremy Siek, and Sam Tobin-Hochstadt. Sound Gradual Typing: Only Mostly Dead. Proceedings of the ACM on Programming Languages 1(OOPSLA), pp. 54:1–54:24, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gavin Bierman, Martin Abadi, and Mads Torgersen. Understanding TypeScript. European Conference on Object-Oriented Programming, pp. 257–281, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Gavin Bierman, Erik Meijer, and Mads Torgersen. Adding Dynamic Types to C#. European Conference on Object-Oriented Programming, pp. 76–100, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Bard Bloom, John Field, Nathaniel Nystrom, Johan Östlund, Gregor Richards, Rok Strniša, Jan Vitek, and Tobias Wrigstad. Thorn: Robust, Concurrent, Extensible Scripting on the JVM. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 117–136, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ambrose Bonnaire-Sergeant, Rowan Davies, and Sam Tobin-Hochstadt. Practical Optional Types for Clojure. European Symposium on Programming, pp. 68–94, 2016.Google ScholarGoogle Scholar
  16. Gilad Bracha and David Griswold. Strongtalk: Typechecking Smalltalk in a Production Environment. Conference on ObjectOriented Programming, Systems, Languages and Applications, pp. 215–230, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ravi Chugh, David Herman, and Ranjit Jhala. Dependent Types for JavaScript. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 587–606, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Benjamin W. Chung, Paley Li, Francesco Zappa Nardelli, and Jan Vitek. KafKa: Gradual Typing for Objects. European Conference on Object-Oriented Programming, pp. 12:1–12:23, 2018.Google ScholarGoogle Scholar
  19. Matteo Cimini and Jeremy G. Siek. The Gradualizer: A Methodology and Algorithm for Generating Gradual Type Systems. Symposium on Principles of Programming Languages, pp. 443–455, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Markus Degen, Peter Thiemann, and Stefan Wehr. The Interaction of Contracts and Laziness. Workshop on Partial Evaluation and Program Manipulation, pp. 97–106, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Christos Dimoulas and Matthias Felleisen. On Contract Satisfaction in a Higher-Order World. Transactions on Programming Languages and Systems 33(5), pp. 16:1–16:29, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Christos Dimoulas, Robert Bruce Findler, Cormac Flanagan, and Matthias Felleisen. Correct Blame for Contracts: No More Scapegoating. Symposium on Principles of Programming Languages, pp. 215–226, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Complete Monitors for Behavioral Contracts. European Symposium on Programming, pp. 214–233, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Robert Bruce Findler, Shu-yu Guo, and Anne Rogers. Lazy Contract Checking for Immutable Data Structures. International Symposium Functional and Logic Programming, pp. 111–128, 2007.Google ScholarGoogle Scholar
  25. Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Stephanie Weirich, and Matthias Felleisen. Catching Bugs in the Web of Program Invariants. Conference on Programming Language Design and Implementation, pp. 23–32, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Michael Furr, Jong-hoon (David) An, Jeffrey S. Foster, and Michael Hicks. Static Type Inference for Ruby. Symposium on Applied Computing, pp. 1859–1866, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Ronald Garcia, Alison M. Clark, and Éric Tanter. Abstracting Gradual Typing. Symposium on Principles of Programming Languages, pp. 429–442, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Kathryn E. Gray, Robert Bruce Findler, and Matthew Flatt. Fine-Grained Interoperability Through Mirrors and Contracts. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 231–245, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Michael Greenberg. Space-Efficient Manifest Contracts. Symposium on Principles of Programming Languages, pp. 181–194, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Ben Greenman and Matthias Felleisen. A Spectrum of Type Soundness and Performance Supplementary Material. Northeastern University, NU-CCIS-2018-002, 2018.Google ScholarGoogle Scholar
  31. Ben Greenman and Zeina Migeed. On the Cost of Type-Tag Soundness. Workshop on Partial Evaluation and Program Manipulation, pp. 30–39, 2018. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Ben Greenman, Asumu Takikawa, Max S. New, Daniel Feltey, Robert Bruce Findler, Jan Vitek, and Matthias Felleisen. How to Evaluate the Performance of Gradual Type Systems. Submitted for publication, 2016.Google ScholarGoogle Scholar
  33. Nevin Heintze. Set-based analysis of ML-programs. LISP and Functional Programming, pp. 306–317, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Thomas S. Heinze, Anders Møller, and Fabio Strucco. Type Safety Analysis for Dart. Dynamic Languages Symposium, pp. 1–12, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Fritz Henglein. Dynamic Typing: Syntax and Proof Theory. Science of Computer Programming 22(3), pp. 197–230, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Fritz Henglein and Jakob Rehof. Safe Polymorphic Type Inference for a Dynamically Typed Language: Translating Scheme to ML. International Conference on Functional Programming Languages and Computer Architecture, pp. 192–203, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient Gradual Typing. Higher-Order and Symbolic Computation 23(2), pp. 167–189, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Yuu Igarashi, Taro Sekiyama, and Atsushi Igarashi. On Polymorphic Gradual Typing. Proceedings of the ACM on Programming Languages 1(ICFP), pp. 40:1–40:29, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Kenneth Knowles and Cormac Flanagan. Hybrid Type Checking. Transactions on Programming Languages and Systems 32(6), pp. 1–34, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Nico Lehmann and Éric Tanter. Gradual Refinement Types. Symposium on Principles of Programming Languages, pp. 775–788, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Xavier Leroy and Michael Mauny. Dynamics in ML. International Conference on Functional Programming Languages and Computer Architecture, pp. 406–426, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Andre Murbach Maidl, Fabio Mascarenhas, and Roberto Ierusalimschy. A Formalization of Typed Lua. Dynamic Languages Symposium, pp. 13–25, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. André Murbach Maidl, Fabio Mascarenhas, and Roberto Ierusalimschy. Typed Lua: An Optional Type System for Lua. Workshop on Dynamic Languages and Applications, pp. 1–10, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Simon Marlow and Philip Wadler. A Practical Subtyping System for Erlang. International Conference on Functional Programming, pp. 136–149, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Jacob Matthews and Robert Bruce Findler. Operational Semantics for Multi-language Programs. Transactions on Programming Languages and Systems 31(3), pp. 1–44, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Philippe Meunier, Robert Bruce Findler, and Matthias Felleisen. Modular Set-Based Analysis from Contracts. Symposium on Principles of Programming Languages, pp. 218–231, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Philippe Meunier, Robert Bruce Findler, Paul Steckler, and Mitchell Wand. Selectors Make Set-Based Analysis Too Hard. Higher-Order and Symbolic Computation 18, pp. 245–269, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Robin Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences 17(3), pp. 348–375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  49. David A. Moon. MACLISP Reference Manual. MIT, Revision 0, 1974.Google ScholarGoogle Scholar
  50. Fabian Muehlboeck and Ross Tate. Sound Gradual Typing is Nominally Alive and Well. Proceedings of the ACM on Programming Languages 1(OOPSLA), pp. 56:1–56:30, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Max S. New and Daniel R. Licata. Call-by-name Gradual Type Theory. International Conference on Formal Structures for Computation and Deduction, 2018.Google ScholarGoogle Scholar
  52. Atsushi Ohori and Kazuhiko Kato. Semantics for Communication Primitives in a Polymorphic Language. Symposium on Principles of Programming Languages, pp. 99–112, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Frédéric Pluquet, Antoine Marot, and Roel Wuyts. Fast Type Reconstruction for Dynamically Typed Programming Languages. Dynamic Languages Symposium, pp. 69–78, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Joe Gibbs Politz, Hannah Quay-de la Vallee, and Shriram Krishnamurthi. Progressive Types. Onward!, pp. 55–66, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Norman Ramsey. Embedding an interpreted language using higher-order functions and types. Journal Functional Programming 21(6), pp. 585–615, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Aseem Rastogi, Avik Chaudhuri, and Basil Hosmer. The Ins and Outs of Gradual Type Inference. Symposium on Principles of Programming Languages, pp. 481–494, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Aseem Rastogi, Nikhil Swamy, Cédric Fournet, Gavin Bierman, and Panagiotis Vekris. Safe & Efficient Gradual Typing for TypeScript. Symposium on Principles of Programming Languages, pp. 167–180, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Brianna M. Ren, John Toman, T. Stephen Strickland, and Jeffrey S. Foster. The Ruby Type Checker. Symposium on Applied Computing, pp. 1565–1572, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. John C. Reynolds. Types, Abstraction, and Parametric Polymorphism. Information Processing, pp. 513–523, 1983.Google ScholarGoogle Scholar
  60. Gregor Richards, Ellen Arteca, and Alexi Turcotte. The VM Already Knew That: Leveraging Compile-Time Knowledge to Optimize Gradual Typing. Proceedings of the ACM on Programming Languages 1(OOPSLA), pp. 55:1–55:27, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Gregor Richards, Zappa Nardelli, Francesco, and Jan Vitek. Concrete Types for TypeScript. European Conference on ObjectOriented Programming, pp. 76–100, 2015.Google ScholarGoogle Scholar
  62. Jeremy Siek, Peter Thiemann, and Philip Wadler. Blame and Coercion: Together Again for the First Time. Conference on Programming Language Design and Implementation, pp. 425–435, 2015a. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Jeremy Siek, Michael M. Vitousek, Matteo Cimmini, Sam Tobin-Hochstadt, and Ronald Garcia. Monotonic References for Efficient Gradual Typing. European Symposium on Programming, pp. 432–456, 2015b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Jeremy G. Siek, Ronald Garcia, and Walid Taha. Exploring the Design Space of Higher-Order Casts. European Symposium on Programming, pp. 17–31, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Jeremy G. Siek and Walid Taha. Gradual Typing for Functional Languages. Scheme and Functional Programming. University of Chicago, TR-2006-06, 2006.Google ScholarGoogle Scholar
  66. Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. Refined Criteria for Gradual Typing. Summit oN Advances in Programming Languages, pp. 274–293, 2015.Google ScholarGoogle Scholar
  67. Jeremy G. Siek and Philip Wadler. Threesomes, with and without blame. Symposium on Principles of Programming Languages, pp. 365–376, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. Vincent St-Amour, Sam Tobin-Hochstadt, and Matthias Felleisen. Optimization coaching. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 163–178, 2012a.Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. Vincent St-Amour, Sam Tobin-Hochstadt, Matthew Flatt, and Matthias Felleisen. Typing the Numeric Tower. Symposium on Practical Aspects of Declarative Languages, pp. 289–303, 2012b. Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. Guy L. Steele. Common Lisp the Language. 2nd edition. Digital Press, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. T. Stephen Strickland, Sam Tobin-Hochstadt, Robert Bruce Findler, and Matthew Flatt. Chaperones and Impersonators: Run-time Support for Reasonable Interposition. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 943–962, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. Norihisa Suzuki. Inferring Types in Smalltalk. Symposium on Principles of Programming Languages, pp. 187–199, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  73. Nikhil Swamy, Michael Hicks, and Gavin M. Bierman. A Theory of Typed Coercions and its Applications. International Conference on Functional Programming, pp. 329–340, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  74. Asumu Takikawa, Daniel Feltey, Earl Dean, Robert Bruce Findler, Matthew Flatt, Sam Tobin-Hochstadt, and Matthias Felleisen. Towards Practical Gradual Typing. European Conference on Object-Oriented Programming, pp. 4–27, 2015.Google ScholarGoogle Scholar
  75. Asumu Takikawa, Daniel Feltey, Ben Greenman, Max S. New, Jan Vitek, and Matthias Felleisen. Is Sound Gradual Typing Dead? Symposium on Principles of Programming Languages, pp. 456–468, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  76. Asumu Takikawa, T. Stephen Strickland, Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Gradual Typing for First-Class Classes. Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 793–810, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  77. Satish Thatte. Quasi-static Typing. Symposium on Principles of Programming Languages, pp. 367–381, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  78. Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage Migration: from Scripts to Programs. Dynamic Languages Symposium, pp. 964–974, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  79. Sam Tobin-Hochstadt and Matthias Felleisen. The Design and Implementation of Typed Scheme. Symposium on Principles of Programming Languages, pp. 395–406, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  80. Sam Tobin-Hochstadt and Matthias Felleisen. Logical Types for Untyped Languages. International Conference on Functional Programming, pp. 117–128, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  81. Sam Tobin-Hochstadt, Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Ben Greenman, Andrew M. Kent, Vincent St-Amour, T. Stephen Strickland, and Asumu Takikawa. Migratory Typing: Ten years later. Summit oN Advances in Programming Languages, pp. 17:1–17:17, 2017.Google ScholarGoogle Scholar
  82. Michael M. Vitousek, Andrew Kent, Jeremy G. Siek, and Jim Baker. Design and Evaluation of Gradual Typing for Python. Dynamic Languages Symposium, pp. 45–56, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  83. Michael M. Vitousek, Cameron Swords, and Jeremy G. Siek. Big Types in Little Runtime: Open-World Soundness and Collaborative Blame for Gradual Type Systems. Symposium on Principles of Programming Languages, pp. 762–774, 2017. Google ScholarGoogle ScholarDigital LibraryDigital Library
  84. Philip Wadler and Robert Bruce Findler. Well-typed Programs Can’t be Blamed. European Symposium on Programming, pp. 1–15, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  85. Jack Williams, J. Garrett Morris, Philip Wadler, and Jakub Zalewski. Mixed Messages: Measuring Conformance and NonInterference in TypeScript. European Conference on Object-Oriented Programming, pp. 28:1–28:29, 2017.Google ScholarGoogle Scholar
  86. Andrew K. Wright and Robert Cartwright. A Practical Soft Type System for Scheme. Transactions on Programming Languages and Systems 19(1), pp. 87–152, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  87. Andrew K. Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, pp. 38–94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  88. Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. Integrating Typed and Untyped Code in a Scripting Language. Symposium on Principles of Programming Languages, pp. 377–388, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A spectrum of type soundness and performance

      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!