The Essence of Dependent Object Types

  • Nada Amin
  • Samuel Grütter
  • Martin OderskyEmail author
  • Tiark Rompf
  • Sandro Stucki
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9600)


Focusing on path-dependent types, the paper develops foundations for Scala from first principles. Starting from a simple calculus D\(_{<:}\) of dependent functions, it adds records, intersections and recursion to arrive at DOT, a calculus for dependent object types. The paper shows an encoding of System F with subtyping in D\(_{<:}\) and demonstrates the expressiveness of DOT by modeling a range of Scala constructs in it.


Calculus Dependent types Scala 



Adriaan Moors, Donna Malayeri and Geoffrey Washburn have contributed to previous versions of DOT. We thank the anonymous reviewers of Wadlerfest for helpful comments on this paper. For insightful discussions we thank Amal Ahmed, Derek Dreyer, Erik Ernst, Matthias Felleisen, Paolo Giarrusso, Scott Kilpatrick, Grzegorz Kossakowski, Alexander Kuklev, Viktor Kuncak, Jon Pretty, Didier Rémy, Lukas Rytz, Miles Sabin, Ilya Sergey, Jeremy Siek, Josh Suereth and Phil Wadler. Contributors to the Dotty project include Dmitry Petrashko, Guillaume Martres, Vladimir Nikolaev, Ondřej Lhoták, Vera Salvisberg and Jason Zaugg. This research was supported by the European Research Council (ERC) under grant 587327 DOPPLER and the Swiss National Science Foundation under grant “Foundations of Scala”.

Supplementary material


  1. Amadio, R.M., Cardelli, L.: Subtyping recursive types. ACM Trans. Program. Lang. Syst. 15(4), 575–631 (1993)CrossRefGoogle Scholar
  2. Amin, N., Moors, A., Odersky, M.: Dependent object types. In: FOOL (2012)Google Scholar
  3. Amin, N., Rompf, T., Odersky, M.: Foundations of path-dependent types. In: OOPSLA (2014)Google Scholar
  4. Ariola, Z.M., Maraist, J., Odersky, M., Felleisen, M., Wadler, P.: A call-by-need lambda calculus. In: POPL (1995)Google Scholar
  5. Cardelli, L., Martini, S., Mitchell, J.C., Scedrov, A.: An extension of system F with subtyping. Inf. Comput. 109(1/2), 4–56 (1994)MathSciNetCrossRefzbMATHGoogle Scholar
  6. Clarke, D., Drossopoulou, S., Noble, J., Wrigstad, T.: Tribe: a simple virtual class calculus. In: AOSD (2007)Google Scholar
  7. Coppo, M., Dezani-Ciancaglini, M., Sallé, P.: Functional characterization of some semantic equalities inside lambda-calculus. In: Automata, Languages and Programming, 6th Colloquium (1979)Google Scholar
  8. Cremet, V., Garillot, F., Lenglet, S., Odersky, M.: A core calculus for scala type checking. In: Královič, R., Urzyczyn, P. (eds.) MFCS 2006. LNCS, vol. 4162, pp. 1–23. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  9. Cretin, J., Rémy, D.: System F with coercion constraints. In: CSL-LICS (2014)Google Scholar
  10. Dreyer, D., Rossberg, A.: Mixin’ up the ML module system. In: ICFP (2008)Google Scholar
  11. Ernst, E.: Family polymorphism. In: Lindskov Knudsen, J. (ed.) ECOOP 2001. LNCS, vol. 2072, p. 303. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  12. Ernst, E.: Higher-order hierarchies. In: ECOOP (2003)Google Scholar
  13. Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: POPL (2006)Google Scholar
  14. Harper, R., Honsell, F., Plotkin, G.: A framework for defining logics. J. ACM 40(1), 143–184 (1993)MathSciNetCrossRefzbMATHGoogle Scholar
  15. Harper, R., Lillibridge, M.: A type-theoretic approach to higher-order modules with sharing. In: POPL (1994)Google Scholar
  16. Adsul, B., Viroli, M.: On variance-based subtyping for parametric types. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, p. 441. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  17. Leroy, X.: Manifest types, modules and separate compilation. In: POPL (1994)Google Scholar
  18. Macqueen, D.: Using dependent types to express modular structure. In: POPL (1986)Google Scholar
  19. Montagu, B., Rémy, D.: Modeling abstract types in modules with open existential types. In: POPL (2009)Google Scholar
  20. Moors, A., Piessens, F., Odersky, M.: Safe type-level abstraction in scala. In: FOOL (2008)Google Scholar
  21. Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A nominal theory of objects with dependent types. In: ECOOP (2003)Google Scholar
  22. Odersky, M., Petrashko, D., Martres, G., others.: The dotty project (2013).
  23. van der Ploeg, A.: The HMap package (2013).
  24. Pretty, J.: Minimizing the slippery surface of failure. Talk at Scala World (2015).
  25. Rompf, T., Amin, N.: From F to DOT: Type soundness proofs with definitional interpreters. Purdue University, Technical report (2015).
  26. Rossberg, A.: 1ML - core and modules united (f-ing first-class modules). In: ICFP (2015)Google Scholar
  27. Rossberg, A., Russo, C.V., Dreyer, D.: F-ing modules. J. Funct. Program. 24(5), 529–607 (2014)MathSciNetCrossRefzbMATHGoogle Scholar
  28. Scherer, G., Rémy, D.: Full reduction in the face of absurdity. In: Vitek, J. (ed.) ESOP 2015. LNCS, vol. 9032, pp. 685–709. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  29. Tate, R., Leung, A., Lerner, S.: Taming wildcards in java’s type system. In: PLDI (2011)Google Scholar
  30. Torgersen, M., Ernst, E., Hansen, C.P.: WildFJ. In: FOOL (2004)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Nada Amin
    • 1
  • Samuel Grütter
    • 1
  • Martin Odersky
    • 1
    Email author
  • Tiark Rompf
    • 2
  • Sandro Stucki
    • 1
  1. 1.EPFLLausanneSwitzerland
  2. 2.Purdue UniversityWest LafayetteUSA

Personalised recommendations