Skip to main content

Integrating Nominal and Structural Subtyping

  • Conference paper
Book cover ECOOP 2008 – Object-Oriented Programming (ECOOP 2008)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5142))

Included in the following conference series:

Abstract

Nominal and structural subtyping each have their own strengths and weaknesses. Nominal subtyping allows programmers to explicitly express design intent, and, when types are associated with run time tags, enables run-time type tests and external method dispatch. On the other hand, structural subtyping is flexible and compositional, allowing unanticipated reuse. To date, nearly all object-oriented languages fully support one subtyping paradigm or the other.

In this paper, we describe a core calculus for a language that integrates the key aspects of nominal and structural subtyping in a unified framework. We have also merged the flexibility of structural subtyping with statically typechecked external methods, a novel combination. We prove type safety for this language and illustrate its practical utility through examples that are not easily expressed in other languages. Our work provides a clean foundation for the design of future languages that enjoy the benefits of both nominal and structural subtyping.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bono, V., Damiani, F., Giachino, E.: Separating Type, Behavior, and State to Achieve Very Fine-grained Reuse. In: Electronic proceedings of FTfJP (2007), http://www.cs.ru.nl/ftfjp/

  2. Bracha, G., Cook, W.: Mixin-based inheritance. In: ECOOP 1990(1990)

    Google Scholar 

  3. Bracha, G., Griswold, D.: Strongtalk: typechecking Smalltalk in a production environment. In: OOPSLA 1993, pp. 215–230 (1993)

    Google Scholar 

  4. Bruce, K.B., Schuett, A., Gent, R.V., Fiech, A.: PolyTOIL: A type-safe polymorphic object-oriented language. ACM Trans. Program. Lang. Syst. 25(2), 225–290 (2003)

    Article  Google Scholar 

  5. Castagna, G., Ghelli, G., Longo, G.: A calculus for overloaded functions with subtyping. Inf. Comput. 117(1), 115–135 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  6. Chambers, C.: Object-oriented multi-methods in Cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  7. Chambers, C.: Cecil Group. The Cecil language: specification and rationale, version 3.2 (February 2004), http://www.cs.washington.edu/research/projects/cecil/

  8. Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM Trans. Program. Lang. Syst. 28(3), 517–575 (2006)

    Article  Google Scholar 

  9. Davies, R., Pfenning, F.: Intersection types and computational effects. In: ICFP 2000, pp. 198–208 (2000)

    Google Scholar 

  10. Fisher, K., Reppy, J.: The design of a class mechanism for Moby. In: PLDI 1999, pp. 37–49 (1999)

    Google Scholar 

  11. Fisher, K., Reppy, J.: Inheritance-based subtyping. Inf. Comput. 177(1), 28–55 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  12. Gil, J., Maman, I.: Whiteoak (2008), http://ssdl-wiki.cs.technion.ac.il/wiki/index.php/Whiteoak

  13. Gregor, D., Järvi, J., Siek, J., Stroustrup, B., Reis, G.D., Lumsdaine, A.: Concepts: Linguistic support for generic programming in C++. In: Proceedings of OOPSLA 2006, October 2006, pp. 291–310. ACM Press, New York (2006)

    Chapter  Google Scholar 

  14. Leroy, X., Doligez, D., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system, release 3.09 (2004), http://caml.inria.fr/pub/docs/manual-ocaml/index.html

  15. Madsen, O.L., Moller-Pedersen, B.: Virtual classes: a powerful mechanism in object-oriented programming. In: OOPSLA 1989, pp. 397–406 (1989)

    Google Scholar 

  16. Malayeri, D., Aldrich, J.: Combining structural subtyping and external dispatch. In: FOOL/WOOD 2007 (January 2007), http://foolwood07.cs.uchicago.edu/program.html

  17. Malayeri, D., Aldrich, J.: Integrating Nominal and Structural Subtyping. Technical Report CMU-CS-08-120, School of Computer Science, Carnegie Mellon University (May 2008)

    Google Scholar 

  18. Sun Microsystems. Java collections API design FAQ (2003), http://java.sun.com/j2se/1.4.2/docs/guide/collections/designfaq.html

  19. Millstein, T.D., Chambers, C.: Modular statically typed multimethods. Inf. Comput. 175(1), 76–118 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  20. Nelson, G. (ed.): Systems programming with Modula-3. Prentice-Hall, Inc., Upper Saddle River (1991)

    Google Scholar 

  21. Nystrom, N., Chong, S., Myers, A.C.: Scalable extensibility via nested inheritance. In: OOPSLA 2004, pp. 99–115 (2004)

    Google Scholar 

  22. Odersky, M.: The Scala language specification (2007), http://www.scala-lang.org/docu/files/ScalaReference.pdf

  23. Ostermann, K.: Nominal and Structural Subtyping in Component-Based Programming. Journal of Object Technology 7(1) (2008)

    Google Scholar 

  24. Reppy, J., Turon, A.: Metaprogramming with traits. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  25. Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable units of behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Jan Vitek

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Malayeri, D., Aldrich, J. (2008). Integrating Nominal and Structural Subtyping. In: Vitek, J. (eds) ECOOP 2008 – Object-Oriented Programming. ECOOP 2008. Lecture Notes in Computer Science, vol 5142. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-70592-5_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-70592-5_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-70591-8

  • Online ISBN: 978-3-540-70592-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics