Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3241653.3241659acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

κDOT: scaling DOT with mutation and constructors

Published: 17 September 2018 Publication History

Abstract

Scala unifies concepts from object and module systems by allowing for objects with type members which are referenced via path-dependent types. The Dependent Object Types (DOT) calculus of Amin et al. models only this core part of Scala, but does not have many fundamental features of Scala such as strict and mutable fields. Since the most commonly used field types in Scala are strict,the correspondence between DOT and Scala is too weak for us to meaningfully prove static analyses safe for Scala by proving them safe for DOT.
A DOT calculus that can support strict and mutable fields together with constructors that do field initialization would be more suitable for analysis of Scala. Toward this goal, we present κDOT, an extension of DOT that supports constructors and field mutation and can emulate the different types of fields in Scala. We have proven κDOT sound through a mechanized proof in Coq. We present the key features of κDOT and its operational semantics and discuss work-in-progress toward making κDOT fully strict.

References

[1]
Nada Amin, Samuel Grütter, Martin Odersky, Tiark Rompf, and Sandro Stucki. 2016. The Essence of Dependent Object Types. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (Lecture Notes in Computer Science), Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella (Eds.), Vol. 9600. Springer, 249-272.
[2]
Nada Amin, Adriaan Moors, and Martin Odersky. 2012. Dependent Object Types. In 19th International Workshop on Foundations of Object-Oriented Languages.
[3]
Nada Amin and Tiark Rompf. 2017. Type soundness proofs with definitional interpreters. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 666-679.
[4]
Nada Amin, Tiark Rompf, and Martin Odersky. 2014. Foundations of path-dependent types. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2014, part of SPLASH 2014, Portland, OR, USA, October 20-24, 2014, Andrew P. Black and Todd D. Millstein (Eds.). ACM, 233-249.
[5]
Brian Aydemir, Arthur Charguéraud, Benjamin C. Pierce, Randy Pollack, and Stephanie Weirich. 2008. Engineering Formal Metatheory. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '08). ACM, New York, NY, USA, 3-15.
[6]
Vincent Cremet, François Garillot, Sergueï Lenglet, and Martin Odersky. 2006. A Core Calculus for Scala Type Checking. In Mathematical Foundations of Computer Science 2006, Rastislav Královi? and Pawel Urzyczyn (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 1-23.
[7]
Manuel Fahndrich and Songtao Xia. 2007. Establishing Object Invariants with Delayed Types. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-oriented Programming Systems and Applications (OOPSLA '07). ACM, New York, NY, USA, 337-350.
[8]
Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. 2001. Featherweight Java: A Minimal Core Calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23, 3 (May 2001), 396-450.
[9]
Julian Mackay, Hannes Mehnert, Alex Potanin, Lindsay Groves, and Nicholas Cameron. 2012. Encoding Featherweight Java with Assignment and Immutability Using the Coq Proof Assistant. In Proceedings of the 14th Workshop on Formal Techniques for Java-like Programs (FTfJP '12). ACM, New York, NY, USA, 11-19.
[10]
Adriaan Moors, Frank Piessens, and Martin Odersky. 2008. Safe type-level abstraction in Scala. In International Workshop on Foundations of Object-Oriented Languages (FOOL 2008).
[11]
Martin Odersky. 2016. Scaling DOT to Scala -- Soundness. http://www.scala-lang.org/blog/2016/02/17/scaling-dot-soundness.html.
[12]
Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. 2003. A Nominal Theory of Objects with Dependent Types. In ECOOP 2003 - Object-Oriented Programming, Luca Cardelli (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 201-224.
[13]
Xin Qi and Andrew C. Myers. 2009. Masked Types for Sound Object Initialization. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '09). ACM, New York, NY, USA, 53-65.
[14]
Marianna Rapoport, Ifaz Kabir, Paul He, and Ond?ej Lhoták. 2017. A Simple Soundness Proof for Dependent Object Types. Proc. ACM Program. Lang. 1, OOPSLA, Article 46 (Oct. 2017), 27 pages.
[15]
Marianna Rapoport and Ond?ej Lhoták. 2017. Mutable WadlerFest DOT. In Proceedings of the 19th Workshop on Formal Techniques for Java-like Programs (FTFJP'17). ACM, New York, NY, USA, Article 7, 6 pages.
[16]
Tiark Rompf and Nada Amin. 2016a. From F to DOT: Type Soundness Proofs with Definitional Interpreters. CoRR abs/1510.05216v2 (2016). http://arxiv.org/abs/1510.05216v2.
[17]
Tiark Rompf and Nada Amin. 2016b. Type soundness for dependent object types (DOT). In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2016, part of SPLASH 2016, Amsterdam, The Netherlands, October 30 - November 4, 2016, Eelco Visser and Yannis Smaragdakis (Eds.). ACM, 624-641.
[18]
Alexander J. Summers and Peter Mueller. 2011. Freedom Before Commitment: A Lightweight Type System for Object Initialisation. In Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA '11). ACM, New York, NY, USA, 1013-1032.
[19]
Andrew K. Wright and Matthias Felleisen. 1994. A Syntactic Approach to Type Soundness. Inf. Comput. 115, 1 (1994), 38-94.

Cited By

View all
  • (2021)Pathless Scala: a calculus for the rest of ScalaProceedings of the 12th ACM SIGPLAN International Symposium on Scala10.1145/3486610.3486894(12-21)Online publication date: 17-Oct-2021
  • (2020)ιDOT: a DOT calculus with object initializationProceedings of the ACM on Programming Languages10.1145/34282764:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2019)A path to DOT: formalizing fully path-dependent typesProceedings of the ACM on Programming Languages10.1145/33605713:OOPSLA(1-29)Online publication date: 10-Oct-2019

Index Terms

  1. κDOT: scaling DOT with mutation and constructors

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    Scala 2018: Proceedings of the 9th ACM SIGPLAN International Symposium on Scala
    September 2018
    82 pages
    ISBN:9781450358361
    DOI:10.1145/3241653
    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

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 17 September 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. dependent object types
    2. mutation
    3. type safety

    Qualifiers

    • Research-article

    Conference

    ICFP '18
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 5 of 6 submissions, 83%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)5
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 13 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2021)Pathless Scala: a calculus for the rest of ScalaProceedings of the 12th ACM SIGPLAN International Symposium on Scala10.1145/3486610.3486894(12-21)Online publication date: 17-Oct-2021
    • (2020)ιDOT: a DOT calculus with object initializationProceedings of the ACM on Programming Languages10.1145/34282764:OOPSLA(1-28)Online publication date: 13-Nov-2020
    • (2019)A path to DOT: formalizing fully path-dependent typesProceedings of the ACM on Programming Languages10.1145/33605713:OOPSLA(1-29)Online publication date: 10-Oct-2019

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media