skip to main content
research-article

Foundations of path-dependent types

Published:15 October 2014Publication History
Skip Abstract Section

Abstract

A scalable programming language is one in which the same concepts can describe small as well as large parts. Towards this goal, Scala unifies concepts from object and module systems. An essential ingredient of this unification is the concept of objects with type members, which can be referenced through path-dependent types. Unfortunately, path-dependent types are not well-understood, and have been a roadblock in grounding the Scala type system on firm theory.

We study several calculi for path-dependent types. We present DOT which captures the essence - DOT stands for Dependent Object Types. We explore the design space bottom-up, teasing apart inherent from accidental complexities, while fully mechanizing our models at each step. Even in this simple setting, many interesting patterns arise from the interaction of structural and nominal features.

Whereas our simple calculus enjoys many desirable and intuitive properties, we demonstrate that the theory gets much more complicated once we add another Scala feature, type refinement, or extend the subtyping relation to a lattice. We discuss possible remedies and trade-offs in modeling type systems for Scala-like languages.

References

  1. N. Amin and T. Rompf. Mind the gap: Artifacts vs insights in pl theory. In OBT, 2014. URL http://popl-obt-2014.cs.brown.edu/papers/gap.pdf.Google ScholarGoogle Scholar
  2. N. Amin, A. Moors, and M. Odersky. Dependent object types. In FOOL, 2012.Google ScholarGoogle Scholar
  3. B. E. Aydemir, A. Bohannon, M. Fairbairn, J. N. Foster, B. C. Pierce, P. Sewell, D. Vytiniotis, G. Washburn, S. Weirich, and S. Zdancewic. Mechanized metatheory for the masses: The PoplMark Challenge. In TPHOLs, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. N. R. Cameron, J. Noble, and T. Wrigstad. Tribal ownership. In OOPSLA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: a simple virtual class calculus. In AOSD, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Courant. An applicative module calculus. In TAPSOFT: Theory and Practice of Software Development. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In MFCS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. D. Dreyer and A. Rossberg. Mixin' up the ML module system. In ICFP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E. Ernst. Family polymorphism. In ECOOP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Ernst. Higher-order hierarchies. In ECOOP, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  11. E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. V. Gasiunas, M. Mezini, and K. Ostermann. Dependent classes. In OOPSLA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Harper. Programming in standard ml, 2013.Google ScholarGoogle Scholar
  14. R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In POPL, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Igarashi and B. C. Pierce. Foundations for virtual types. Inf. Comput., 175 (1): 34--49, 2002.Google ScholarGoogle ScholarCross RefCross Ref
  16. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight java: a minimal core calculus for java and gj. ACM Trans. Program. Lang. Syst., 23 (3), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Klein, J. Clements, C. Dimoulas, C. Eastlund, M. Felleisen, M. Flatt, J. A. McCarthy, J. Rafkind, S. Tobin-Hochstadt, and R. B. Findler. Run your research: on the effectiveness of lightweight mechanization. In POPL, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. K. R. M. Leino. Dafny: An automatic program verifier for functional correctness. In LPAR (Dakar), 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. X. Leroy. Manifest types, modules and separate compilation. In POPL, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. X. Leroy. A modular module system. Journal of Functional Programming, 10: 269--303, May 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Macqueen. Using dependent types to express modular structure. In POPL, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. The Coq development team. The Coq proof assistant reference manual, 2012. URL http://coq.inria.fr. Version 8.4.Google ScholarGoogle Scholar
  23. R. Milner, M. Tofte, and D. Macqueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997. Google ScholarGoogle ScholarCross RefCross Ref
  24. A. Moors, F. Piessens, and M. Odersky. Safe type-level abstraction in Scala. In FOOL, 2008.Google ScholarGoogle Scholar
  25. N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In OOPSLA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Odersky, V. Cremet, C. Röckl, and M. Zenger. A nominal theory of objects with dependent types. In ECOOP, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  27. F. Pfenning and C. Schürmann. In CADE, 1999.Google ScholarGoogle Scholar
  28. J. Siek. Type safety in three easy lemmas. http://siek.blogspot.ch/2013/05/type-safety-in-three-easy-lemmas.html, 2013.Google ScholarGoogle Scholar
  29. J. G. Siek and W. Taha. Gradual typing for objects. In ECOOP, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. Tate. Mixed-site variance. In FOOL, 2013.Google ScholarGoogle Scholar
  31. A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Inf. Comput., 115 (1): 38--94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Foundations of path-dependent types

            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

            • Published in

              cover image ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 49, Issue 10
              OOPSLA '14
              October 2014
              907 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/2714064
              • Editor:
              • Andy Gill
              Issue’s Table of Contents
              • cover image ACM Conferences
                OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications
                October 2014
                946 pages
                ISBN:9781450325851
                DOI:10.1145/2660193

              Copyright © 2014 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 15 October 2014

              Check for updates

              Qualifiers

              • research-article

            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!