skip to main content
10.1145/2837614.2837630acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article
Public Access

Is sound gradual typing dead?

Published: 11 January 2016 Publication History

Abstract

Programmers have come to embrace dynamically-typed languages for prototyping and delivering large and complex systems. When it comes to maintaining and evolving these systems, the lack of explicit static typing becomes a bottleneck. In response, researchers have explored the idea of gradually-typed programming languages which allow the incremental addition of type annotations to software written in one of these untyped languages. Some of these new, hybrid languages insert run-time checks at the boundary between typed and untyped code to establish type soundness for the overall system. With sound gradual typing, programmers can rely on the language implementation to provide meaningful error messages when type invariants are violated. While most research on sound gradual typing remains theoretical, the few emerging implementations suffer from performance overheads due to these checks. None of the publications on this topic comes with a comprehensive performance evaluation. Worse, a few report disastrous numbers. In response, this paper proposes a method for evaluating the performance of gradually-typed programming languages. The method hinges on exploring the space of partial conversions from untyped to typed. For each benchmark, the performance of the different versions is reported in a synthetic metric that associates runtime overhead to conversion effort. The paper reports on the results of applying the method to Typed Racket, a mature implementation of sound gradual typing, using a suite of real-world programs of various sizes and complexities. Based on these results the paper concludes that, given the current state of implementation technologies, sound gradual typing faces significant challenges. Conversely, it raises the question of how implementations could reduce the overheads associated with soundness and how tools could be used to steer programmers clear from pathological cases.

Supplementary Material

Auxiliary Archive (p456-takikawa-s.zip)
An artifact containing a VirtualBox image that accompanies the paper "Is Sound Gradual Typing Dead?".

References

[1]
Martin Abadi, Luca Cardelli, Benjamin C. Pierce, and Gordon D. Plotkin. Dynamic Typing in a Statically Typed Language. ACM Transactions on Programming Languages and Systems 13(2), pp. 237–268, 1991.
[2]
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.
[3]
Esteban Allende, Johan Fabry, Ronald Garcia, and Éric Tanter. Confined Gradual Typing. In Proc. ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 251–270, 2014.
[4]
Esteban Allende, Johan Fabry, and Éric Tanter. Cast Insertion Strategies for Gradually-Typed Objects. In Proc. Dynamic Languages Symposium, pp. 27–36, 2013.
[5]
Spenser Bauman, Carl Friedrich Bolz, Robert Hirschfield, Vasily Kirilichev, Tobias Pape, Jeremy G. Siek, and Sam Tobin-Hochstadt. Pycket: A Tracing JIT For a Functional Language. In Proc. ACM International Conference on Functional Programming, pp. 22–34, 2015.
[6]
Gavin Bierman, Martin Abadi, and Mads Torgersen. Understanding TypeScript. In Proc. European Conference on Object-Oriented Programming, pp. 257–281, 2014.
[7]
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. In Proc. ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 117–136, 2009.
[8]
Ambrose Bonnaire-Sergeant. A Practical Optional Type System for Clojure. Honour’s dissertation, University of Western Australia, 2012.
[9]
Gilad Bracha. Pluggable Type Systems. In Proc. OOPSLA Workshop on Revival of Dynamic Languages, 2004.
[10]
Gilad Bracha and David Griswold. Strongtalk: Typechecking Smalltalk in a Production Environment. In Proc. ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 215–230, 1993.
[11]
Mason Chang, Bernd Mathiske, Edwin Smith, Avik Chaudhuri, Andreas Gal, Michael Bebenita, Christian Wimmer, and Michael Franz. The Impact of Optional Type Information on JIT Compilation of Dynamically Typed Languages. In Proc. Dynamic Languages Symposium, pp. 13–24, 2011.
[12]
Robert Bruce Findler and Matthias Felleisen. Contracts for Higher-Order Functions. In Proc. ACM International Conference on Functional Programming, pp. 48–59, 2002.
[13]
Fritz Henglein and Jakob Rehof. Safe Polymorphic Type Inference for a Dynamically Typed Language: Translating Scheme to ML. In Proc. ACM International Conference on Functional Programming Languages and Computer Architecture, pp. 192–203, 1995.
[14]
André Murbach Maidl, Fabio Mascarenhas, and Roberto Ierusalimschy. Typed Lua: An Optional Type System for Lua. In Proc. Workshop on Dynamic Languages and Applications, pp. 1–10, 2014.
[15]
David A. Moon. MACLISP Reference Manual. 1974.
[16]
Phúc C. Nguy˜ên, Sam Tobin-Hochstadt, and David Van Horn. Soft Contract Verification. In Proc. ACM International Conference on Functional Programming, pp. 139–152, 2014.
[17]
Matthew M. Papi, Mahmood Ali, Telmo Louis Correa, Jr., Jeff H. Perkins, and Michael D. Ernst. Practical Pluggable Types for Java. In Proc. International Symposium on Software Testing and Analysis, pp. 201–212, 2008.
[18]
Aseem Rastogi, Nikhil Swamy, Cédric Fournet, Gavin Bierman, and Panagiotis Vekris. Safe & Efficient Gradual Typing for TypeScript. In Proc. ACM Symposium on Principles of Programming Languages, pp. 167––180, 2015.
[19]
Gregor Richards, Francesco Zappa Nardelli, and Jan Vitek. Concrete Types for TypeScript. In Proc. European Conference on Object-Oriented Programming, pp. 76–100, 2015.
[20]
Michael Scriven. The Methodology of Evaluation. Perspectives of Curriculum Evaluation. Rand McNally, 1967.
[21]
Jeremy G. Siek and Walid Taha. Gradual Typing for Functional Languages. In Proc. Scheme and Functional Programming Workshop, 2006.
[22]
Jeremy G. Siek and Philip Wadler. Threesomes, with and without blame. In Proc. ACM Symposium on Principles of Programming Languages, pp. 365–376, 2010.
[23]
Vincent St-Amour, Leif Andersen, and Matthias Felleisen. Featurespecific Profiling. In Proc. International Conference on Compiler Construction, pp. 49–68, 2015.
[24]
Vincent St-Amour, Sam Tobin-Hochstadt, and Matthias Felleisen. Optimization coaching. In Proc. ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 163–178, 2012.
[25]
Asumu Takikawa, Daniel Feltey, Earl Dean, Robert Bruce Findler, Matthew Flatt, Sam Tobin-Hochstadt, and Matthias Felleisen. Towards Practical Gradual Typing. In Proc. European Conference on Object-Oriented Programming, pp. 4–27, 2015.
[26]
Sam Tobin-Hochstadt and Matthias Felleisen. Interlanguage Migration: from Scripts to Programs. In Proc. Dynamic Languages Symposium, pp. 964–974, 2006.
[27]
Sam Tobin-Hochstadt, Vincent St-Amour, Ryan Culpepper, Matthew Flatt, and Matthias Felleisen. Languages as Libraries. In Proc. ACM Conference on Programming Language Design and Implementation, pp. 132–141, 2011.
[28]
Michael M. Vitousek, Andrew Kent, Jeremy G. Siek, and Jim Baker. Design and Evaluation of Gradual Typing for Python. In Proc. Dynamic Languages Symposium, pp. 45–56, 2014.
[29]
Andrew K. Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, pp. 38–94, 1994.
[30]
Tobias Wrigstad, Francesco Zappa Nardelli, Sylvain Lebresne, Johan Östlund, and Jan Vitek. Integrating Typed and Untyped Code in a Scripting Language. In Proc. ACM Symposium on Principles of Programming Languages, pp. 377–388, 2010.

Cited By

View all
  • (2024)Typed and Confused: Studying the Unexpected Dangers of Gradual TypingProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695549(1858-1870)Online publication date: 27-Oct-2024
  • (2024)Merging Gradual TypingProceedings of the ACM on Programming Languages10.1145/36897348:OOPSLA2(648-676)Online publication date: 8-Oct-2024
  • (2024)Use Site Checking Considered HarmfulProceedings of the 2024 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3689492.3689814(275-287)Online publication date: 17-Oct-2024
  • Show More Cited By

Index Terms

  1. Is sound gradual typing dead?

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
    January 2016
    815 pages
    ISBN:9781450335492
    DOI:10.1145/2837614
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 51, Issue 1
      POPL '16
      January 2016
      815 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2914770
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
    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].

    Sponsors

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 11 January 2016

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Gradual typing
    2. performance evaluation

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    POPL '16
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 824 of 4,130 submissions, 20%

    Upcoming Conference

    POPL '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)298
    • Downloads (Last 6 weeks)51
    Reflects downloads up to 06 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Typed and Confused: Studying the Unexpected Dangers of Gradual TypingProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695549(1858-1870)Online publication date: 27-Oct-2024
    • (2024)Merging Gradual TypingProceedings of the ACM on Programming Languages10.1145/36897348:OOPSLA2(648-676)Online publication date: 8-Oct-2024
    • (2024)Use Site Checking Considered HarmfulProceedings of the 2024 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3689492.3689814(275-287)Online publication date: 17-Oct-2024
    • (2024)RichWasm: Bringing Safe, Fine-Grained, Shared-Memory Interoperability Down to WebAssemblyProceedings of the ACM on Programming Languages10.1145/36564448:PLDI(1656-1679)Online publication date: 20-Jun-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)Type-Based Gradual Typing Performance OptimizationProceedings of the ACM on Programming Languages10.1145/36329318:POPL(2667-2699)Online publication date: 5-Jan-2024
    • (2024)Static Blame for gradual typingJournal of Functional Programming10.1017/S095679682400002934Online publication date: 25-Mar-2024
    • (2024)Gradual Typing Performance, Micro Configurations and Macro PerspectivesTheoretical Aspects of Software Engineering10.1007/978-3-031-64626-3_15(261-278)Online publication date: 29-Jul-2024
    • (2023)Gradual Typing for Effect HandlersProceedings of the ACM on Programming Languages10.1145/36228607:OOPSLA2(1758-1786)Online publication date: 16-Oct-2023
    • (2023)How to Evaluate Blame for Gradual Types, Part 2Proceedings of the ACM on Programming Languages10.1145/36078367:ICFP(159-186)Online publication date: 31-Aug-2023
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media