Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Sound gradual typing is nominally alive and well

Published: 12 October 2017 Publication History
  • Get Citation Alerts
  • 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.

    Supplementary Material

    Auxiliary Archive (oopsla17-oopsla185-aux.zip)

    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.
    [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.
    [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.
    [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.
    [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.
    [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.
    [7]
    Gavin Bierman, Erik Meijer, and Mads Torgersen. 2010. Adding Dynamic Types to C# . In ECOOP 2010. Springer Berlin Heidelberg, Berlin, Heidelberg, 76–100.
    [8]
    Gilad Bracha. 2004. Pluggable Type Systems . (2004). In Workshop on Revival of Dynamic Languages.
    [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.
    [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.
    [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.
    [12]
    Facebook, Inc. 2016. The Hack Language Specification, Version 1.1 . (April 2016).
    [13]
    Robert Bruce Findler and Matthias Felleisen. 2002. Contracts for Higher-Order Functions . In ICFP 2002. ACM, New York, NY, USA, 48–59.
    [14]
    Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing . In POPL 2016. ACM, New York, NY, USA, 429–442.
    [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.
    [16]
    Radu Grigore. 2017. Java Generics are Turing Complete . In POPL 2017. ACM, New York, NY, USA, 73–85.
    [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.
    [18]
    Fritz Henglein. 1994. Dynamic Typing: Syntax and Proof Theory . Science of Computer Programming 22, 3 (1994), 197 – 230.
    [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.
    [20]
    Lintaro Ina and Atsushi Igarashi. 2011. Gradual Typing for Generics . In OOPSLA 2011. ACM, New York, NY, USA, 609–624.
    [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.
    [22]
    Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-Language Programs . In POPL 2007. ACM, New York, NY, USA, 3–10.
    [23]
    Microsoft. 2012. TypeScript . (Oct. 2012).
    [24]
    The Python Development Team. 2008. Python Benchmarks . https://hg.python.org/benchmarks/ . (Dec. 2008).
    [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.
    [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.
    [27]
    Michel Schinz. 2005. Compiling Scala for the Java Virtual Machine . Ph.D. Dissertation. EPFL.
    [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.
    [29]
    Jeremy Siek and Walid Taha. 2007. Gradual Typing for Objects . In ECOOP 2007. Springer-Verlag, Berlin, Heidelberg, 2–27.
    [30]
    Jeremy G Siek and Walid Taha. 2006. Gradual Typing for Functional Languages . Scheme and Functional Programming Workshop 6 (2006), 81–92.
    [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.
    [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.
    [33]
    Jeremy G. Siek and Philip Wadler. 2010. Threesomes, with and without Blame . In POPL 2010. ACM, New York, NY, USA, 365–376.
    [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.
    [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.
    [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.
    [37]
    Sam Tobin-Hochstadt and Matthias Felleisen. 2006. Interlanguage Migration: From Scripts to Programs . In OOPSLA 2006. ACM, New York, NY, USA, 964–974.
    [38]
    Matías Toro and Éric Tanter. 2017. A Gradual Interpretation of Union Types . In SAS 2017. Springer International Publishing, Cham, 382–404.
    [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.
    [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.
    [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.
    [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.

    Cited By

    View all
    • (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)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-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
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    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
    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 for this article.

    Check for updates

    Badges

    Author Tags

    1. Gradual Typing
    2. Immediate Accountability
    3. Nominal
    4. Transparency

    Qualifiers

    • Research-article

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)120
    • Downloads (Last 6 weeks)28
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (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)Gradually Typed Languages Should Be Vigilant!Proceedings of the ACM on Programming Languages10.1145/36498428:OOPSLA1(864-892)Online publication date: 29-Apr-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
    • (2023)GTP Benchmarks for Gradual Typing PerformanceProceedings of the 2023 ACM Conference on Reproducibility and Replicability10.1145/3589806.3600034(102-114)Online publication date: 27-Jun-2023
    • (2022)Highly illogical, Kirk: spotting type mismatches in the large despite broken contracts, unsound types, and too many lintersProceedings of the ACM on Programming Languages10.1145/35633056:OOPSLA2(479-504)Online publication date: 31-Oct-2022
    • (2021)Transitioning from structural to nominal code with efficient gradual typingProceedings of the ACM on Programming Languages10.1145/34855045:OOPSLA(1-29)Online publication date: 15-Oct-2021
    • (2021)How to evaluate blame for gradual typesProceedings of the ACM on Programming Languages10.1145/34735735:ICFP(1-29)Online publication date: 19-Aug-2021
    • (2021)Naïve transient cast insertion isn't (that) badProceedings of the 16th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems10.1145/3464972.3472395(1-9)Online publication date: 13-Jul-2021
    • (2021)Corpse reviver: sound and efficient gradual typing via contract verificationProceedings of the ACM on Programming Languages10.1145/34343345:POPL(1-28)Online publication date: 4-Jan-2021
    • 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

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media