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.
Supplemental Material
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Esteban Allende, Johan Fabry, and Éric Tanter. Cast Insertion Strategies for Gradually-Typed Objects. Dynamic Languages Symposium, pp. 27–36, 2013. Google Scholar
Digital Library
- Christopher Anderson, Paola Giannini, and Sophia Drossopoulou. Towards Type Inference for JavaScript. European Conference on Object-Oriented Programming, pp. 428–452, 2005. Google Scholar
Digital Library
- Henk Barendregt. The Lambda Calculus: Its Syntax and Semantics. North-Holland Publishing Company, 1981.Google Scholar
- Gilles Barthe. Implicit Coercions in Type Systems. International Workshop on Types for Proofs and Programs, pp. 1–15, 1995. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Gavin Bierman, Martin Abadi, and Mads Torgersen. Understanding TypeScript. European Conference on Object-Oriented Programming, pp. 257–281, 2014. Google Scholar
Digital Library
- Gavin Bierman, Erik Meijer, and Mads Torgersen. Adding Dynamic Types to C#. European Conference on Object-Oriented Programming, pp. 76–100, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Ambrose Bonnaire-Sergeant, Rowan Davies, and Sam Tobin-Hochstadt. Practical Optional Types for Clojure. European Symposium on Programming, pp. 68–94, 2016.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Christos Dimoulas, Sam Tobin-Hochstadt, and Matthias Felleisen. Complete Monitors for Behavioral Contracts. European Symposium on Programming, pp. 214–233, 2012. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Ronald Garcia, Alison M. Clark, and Éric Tanter. Abstracting Gradual Typing. Symposium on Principles of Programming Languages, pp. 429–442, 2016. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Michael Greenberg. Space-Efficient Manifest Contracts. Symposium on Principles of Programming Languages, pp. 181–194, 2015. Google Scholar
Digital Library
- Ben Greenman and Matthias Felleisen. A Spectrum of Type Soundness and Performance Supplementary Material. Northeastern University, NU-CCIS-2018-002, 2018.Google Scholar
- Ben Greenman and Zeina Migeed. On the Cost of Type-Tag Soundness. Workshop on Partial Evaluation and Program Manipulation, pp. 30–39, 2018. Google Scholar
Digital Library
- 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 Scholar
- Nevin Heintze. Set-based analysis of ML-programs. LISP and Functional Programming, pp. 306–317, 1994. Google Scholar
Digital Library
- Thomas S. Heinze, Anders Møller, and Fabio Strucco. Type Safety Analysis for Dart. Dynamic Languages Symposium, pp. 1–12, 2016. Google Scholar
Digital Library
- Fritz Henglein. Dynamic Typing: Syntax and Proof Theory. Science of Computer Programming 22(3), pp. 197–230, 1994. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- David Herman, Aaron Tomb, and Cormac Flanagan. Space-efficient Gradual Typing. Higher-Order and Symbolic Computation 23(2), pp. 167–189, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Kenneth Knowles and Cormac Flanagan. Hybrid Type Checking. Transactions on Programming Languages and Systems 32(6), pp. 1–34, 2010. Google Scholar
Digital Library
- Nico Lehmann and Éric Tanter. Gradual Refinement Types. Symposium on Principles of Programming Languages, pp. 775–788, 2017. Google Scholar
Digital Library
- Xavier Leroy and Michael Mauny. Dynamics in ML. International Conference on Functional Programming Languages and Computer Architecture, pp. 406–426, 1991. Google Scholar
Digital Library
- Andre Murbach Maidl, Fabio Mascarenhas, and Roberto Ierusalimschy. A Formalization of Typed Lua. Dynamic Languages Symposium, pp. 13–25, 2015. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Simon Marlow and Philip Wadler. A Practical Subtyping System for Erlang. International Conference on Functional Programming, pp. 136–149, 1997. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Robin Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences 17(3), pp. 348–375, 1978.Google Scholar
Cross Ref
- David A. Moon. MACLISP Reference Manual. MIT, Revision 0, 1974.Google Scholar
- 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 Scholar
Digital Library
- Max S. New and Daniel R. Licata. Call-by-name Gradual Type Theory. International Conference on Formal Structures for Computation and Deduction, 2018.Google Scholar
- Atsushi Ohori and Kazuhiko Kato. Semantics for Communication Primitives in a Polymorphic Language. Symposium on Principles of Programming Languages, pp. 99–112, 1993. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Joe Gibbs Politz, Hannah Quay-de la Vallee, and Shriram Krishnamurthi. Progressive Types. Onward!, pp. 55–66, 2012. Google Scholar
Digital Library
- Norman Ramsey. Embedding an interpreted language using higher-order functions and types. Journal Functional Programming 21(6), pp. 585–615, 2008. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- John C. Reynolds. Types, Abstraction, and Parametric Polymorphism. Information Processing, pp. 513–523, 1983.Google Scholar
- 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 Scholar
Digital Library
- Gregor Richards, Zappa Nardelli, Francesco, and Jan Vitek. Concrete Types for TypeScript. European Conference on ObjectOriented Programming, pp. 76–100, 2015.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Jeremy G. Siek and Walid Taha. Gradual Typing for Functional Languages. Scheme and Functional Programming. University of Chicago, TR-2006-06, 2006.Google Scholar
- 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 Scholar
- Jeremy G. Siek and Philip Wadler. Threesomes, with and without blame. Symposium on Principles of Programming Languages, pp. 365–376, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Guy L. Steele. Common Lisp the Language. 2nd edition. Digital Press, 1990. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Norihisa Suzuki. Inferring Types in Smalltalk. Symposium on Principles of Programming Languages, pp. 187–199, 1981. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Satish Thatte. Quasi-static Typing. Symposium on Principles of Programming Languages, pp. 367–381, 1990. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage Migration: from Scripts to Programs. Dynamic Languages Symposium, pp. 964–974, 2006. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. The Design and Implementation of Typed Scheme. Symposium on Principles of Programming Languages, pp. 395–406, 2008. Google Scholar
Digital Library
- Sam Tobin-Hochstadt and Matthias Felleisen. Logical Types for Untyped Languages. International Conference on Functional Programming, pp. 117–128, 2010. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Philip Wadler and Robert Bruce Findler. Well-typed Programs Can’t be Blamed. European Symposium on Programming, pp. 1–15, 2009. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- Andrew K. Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, pp. 38–94, 1994. Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
A spectrum of type soundness and performance
Recommendations
On the cost of type-tag soundness
PEPM '18: Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Program ManipulationGradual typing systems ensure type soundness by transforming static type annotations into run-time checks. These checks provide semantic guarantees, but may come at a large cost in performance. In particular, recent work by Takikawa et al. suggests ...
A church-style intermediate language for MLF
MLF is a type system that seamlessly merges ML-style implicit but second-class polymorphism with System-F explicit first-class polymorphism. We present xMLF, a Church-style version of MLF with full type information that can easily be maintained during ...
Semantic type qualifiers
PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementationWe present a new approach for supporting user-defined type refinements, which augment existing types to specify and check additional invariants of interest to programmers. We provide an expressive language in which users define new refinements and ...






Comments