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.
- 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 Scholar
- N. Amin, A. Moors, and M. Odersky. Dependent object types. In FOOL, 2012.Google Scholar
- 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 Scholar
Digital Library
- N. R. Cameron, J. Noble, and T. Wrigstad. Tribal ownership. In OOPSLA, 2010. Google Scholar
Digital Library
- D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: a simple virtual class calculus. In AOSD, 2007. Google Scholar
Digital Library
- J. Courant. An applicative module calculus. In TAPSOFT: Theory and Practice of Software Development. 1997. Google Scholar
Digital Library
- V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In MFCS, 2006. Google Scholar
Digital Library
- D. Dreyer and A. Rossberg. Mixin' up the ML module system. In ICFP, 2008. Google Scholar
Digital Library
- E. Ernst. Family polymorphism. In ECOOP, 2001. Google Scholar
Digital Library
- E. Ernst. Higher-order hierarchies. In ECOOP, 2003.Google Scholar
Cross Ref
- E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL, 2006. Google Scholar
Digital Library
- V. Gasiunas, M. Mezini, and K. Ostermann. Dependent classes. In OOPSLA, 2007. Google Scholar
Digital Library
- R. Harper. Programming in standard ml, 2013.Google Scholar
- R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In POPL, 1994. Google Scholar
Digital Library
- A. Igarashi and B. C. Pierce. Foundations for virtual types. Inf. Comput., 175 (1): 34--49, 2002.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- K. R. M. Leino. Dafny: An automatic program verifier for functional correctness. In LPAR (Dakar), 2010. Google Scholar
Digital Library
- X. Leroy. Manifest types, modules and separate compilation. In POPL, 1994. Google Scholar
Digital Library
- X. Leroy. A modular module system. Journal of Functional Programming, 10: 269--303, May 2000. Google Scholar
Digital Library
- D. Macqueen. Using dependent types to express modular structure. In POPL, 1986. Google Scholar
Digital Library
- The Coq development team. The Coq proof assistant reference manual, 2012. URL http://coq.inria.fr. Version 8.4.Google Scholar
- R. Milner, M. Tofte, and D. Macqueen. The Definition of Standard ML. MIT Press, Cambridge, MA, USA, 1997. Google Scholar
Cross Ref
- A. Moors, F. Piessens, and M. Odersky. Safe type-level abstraction in Scala. In FOOL, 2008.Google Scholar
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In OOPSLA, 2004. Google Scholar
Digital Library
- M. Odersky, V. Cremet, C. Röckl, and M. Zenger. A nominal theory of objects with dependent types. In ECOOP, 2003.Google Scholar
Cross Ref
- F. Pfenning and C. Schürmann. In CADE, 1999.Google Scholar
- J. Siek. Type safety in three easy lemmas. http://siek.blogspot.ch/2013/05/type-safety-in-three-easy-lemmas.html, 2013.Google Scholar
- J. G. Siek and W. Taha. Gradual typing for objects. In ECOOP, 2007. Google Scholar
Digital Library
- R. Tate. Mixed-site variance. In FOOL, 2013.Google Scholar
- A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Inf. Comput., 115 (1): 38--94, 1994. Google Scholar
Digital Library
Index Terms
Foundations of path-dependent types
Recommendations
Foundations of path-dependent types
OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & ApplicationsA 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 ...
Cayenne—a language with dependent types
Cayenne is a Haskell-like language. The main difference between Haskell and Cayenne is that Cayenne has dependent types, i.e., the result type of a function may depend on the argument value, and types of record components (which can be types or values) ...
Type Theory based on Dependent Inductive and Coinductive Types
LICS '16: Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer ScienceWe develop a dependent type theory that is based purely on inductive and coinductive types, and the corresponding recursion and corecursion principles. This results in a type theory with a small set of rules, while still being fairly expressive. For ...







Comments