Advertisement

Modular Statically Typed Multimethods

  • Todd Millstein
  • Craig Chambers
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1628)

Abstract

Multimethods offer several well-known advantages over the single dispatching of conventional object-oriented languages, including a simple solution to the ”binary method“ problem, cleaner implementations of the “visitor,” “strategy,” and similar design patterns, and a form of “open objects.” However, previous work on statically typed multimethods whose arguments are treated symmetrically has required the whole program to be available in order to perform typechecking. We describe Dubious, a simple core language including first-class generic functions with symmetric multimethods, a classless object model, and modules that can be separately typechecked. We identify two sets of restrictions that ensure modular type safety for Dubious as well as an interesting intermediate point between these two.We have proved each of these modular type systems sound.

Keywords

Open Object Concrete Object Binary Method Graphic Object Argument Position 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [Abadi & Cardelli 95]
    Martín Abadi and Luca Cardelli. An Imperative Object Calculus. Theory and Practice of Object Systems, 1(3):151–166, 1995.Google Scholar
  2. [Abadi & Cardelli 96]
    Martín Abadi and Luca Cardelli. A Theory of Objects. Springer-Verlag, New York, 1996.zbMATHGoogle Scholar
  3. [Agrawal et al. 91]
    Rakesh Agrawal, Linda G. DeMichiel, and Bruce G. Lindsay. Static Type Checking of Multi-Methods. OOPSLA’91 Conference Proceedings, Phoenix, AZ, October, 1991, volume 26, number 11 of ACM SIGPLAN Notices, pp. 113–128. ACM, New York, November, 1991.Google Scholar
  4. [Arnold & Gosling 98]
    Ken Arnold and James Gosling. The Java Programming Language. Second Edition, Addison-Wesley, Reading, Mass., 1998.Google Scholar
  5. [Baumgartner et al. 96]
    Gerald Baumgartner, Konstantin Läufer, and Vincent F. Russo. On the Interaction of Object-Oriented Design Patterns and Programming Languages. Technical Report CSD-TR-96-020, Department of Computer Science, Purdue University, February 1996.Google Scholar
  6. [Bourdoncle & Merz 97]
    François Bourdoncle and Stephan Merz. Type Checking Higher-Order Polymorphic Multi-Methods. Conference Record of POPL’ 97: The 24th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, Paris, France, pp. 302–315. ACM, New York, January 1997.CrossRefGoogle Scholar
  7. [Boyland & Castagna 97]
    John Boyland and Giuseppe Castagna. Parasitic Methods: An Implementation of Multi-Methods for Java. Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, volume 32, number 10 of ACM SIGPLAN Notices, pp. 66–76. ACM, New York, November 1997.CrossRefGoogle Scholar
  8. [Bracha & Cook 90]
    Gilad Bracha and William Cook. Mixin-Based Inheritance. Proceedings of the Joint ACM Conference on Object-Oriented Programming Systems, Languages and Applications and the European Conference on Object-Oriented Programming, Ottawa, Canada, October 1990.Google Scholar
  9. [Bruce et al. 95]
    Kim Bruce, Luca Cardelli, Giuseppe Castagna, The Hopkins Object Group, Gary T. Leavens, and Benjamin Pierce. On Binary Methods. Theory and Practice of Object Systems, 1(3):221–242, 1995.Google Scholar
  10. [Canning et al. 89]
    Peter Canning, William Cook, Walter Hill, Walter Olthoff, John C. Mitchell. F-Bounded Polymorphism for Object-Oriented Programming. Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, pages 273–280, September 1989.Google Scholar
  11. [Cardelli 84]
    Luca Cardelli. A Semantics of Multiple Inheritance. Semantics of Data Types Symposium, LNCS 173, pp. 51–66, Springer-Verlag, 1984.Google Scholar
  12. [Castagna et al. 92]
    Giuseppe Castagna, Giorgio Ghelli, and Giuseppe Longo. A Calculus for Overloaded Functions with Subtyping. Proceedings of the 1992 ACM Conference on Lisp and Functional Programming, San Francisco, June, 1992, pp. 182–192, volume 5, number 1 of LISP Pointers. ACM, New York, January-March, 1992.CrossRefGoogle Scholar
  13. [Castagna 95]
    Giuseppe Castagna. Covariance and contravariance: conflict without a cause. ACM Transactions on Programming Languages and Systems, 17(3):431–447, 1995.CrossRefGoogle Scholar
  14. [Castagna 97]
    Giuseppe Castagna. Object-Oriented Programming A Unified Foundation, Birkhäuser, Boston, 1997.Google Scholar
  15. [Chambers 92]
    Craig Chambers. Object-Oriented Multi-Methods in Cecil. ECOOP’ 92 Conference Proceedings, Utrecht, the Netherlands, June/July, 1992, volume 615 of Lecture Notes in Computer Science, pp. 33–56. Springer-Verlag, Berlin, 1992.Google Scholar
  16. [Chambers 95]
    Craig Chambers. The Cecil Language: Specification and Rationale: Version 2.0. Department of Computer Science and Engineering, University of Washington, December, 1995. http://www.cs.washington.edu/research/projects/cecil/www/Papers/cecil-spec.html
  17. [Chambers & Leavens 95]
    Craig Chambers and Gary T. Leavens. Typechecking and Modules for Multi-Methods. ACM Transactions on Programming Languages and Systems, 17(6):805–843. November, 1995.CrossRefGoogle Scholar
  18. [Chambers & Leavens 97]
    Craig Chambers and Gary T. Leavens. BeCecil, A Core Object-Oriented Language with Block Structure and Multimethods: Semantics and Typing. The Fourth International Workshop on the Foundations of Object-oriented Languages, Paris, France, January 1997.Google Scholar
  19. [Chambers 98]
    Craig Chambers. Towards Diesel, a Next-Generation OO Language after Cecil. Invited talk, The Fifth Workshop on Foundations of Object-oriented Languages, San Diego, California, January 1998.Google Scholar
  20. [Cook 90]
    William Cook. Object-Oriented Programming versus Abstract Data Types. Foundations of Object-Oriented Languages, REX School/Workshop Proceedings, Noordwijkerhout, the Netherlands, May/June, 1990, volume 489 of Lecture Notes in Computer Science, pp. 151–178. Springer-Verlag, New York, 1991.Google Scholar
  21. [Ernst et al. 98]
    Michael D. Ernst, Craig Kaplan, and Craig Chambers. Predicate Dispatching: A Unified Theory of Dispatch. Twelfth European Conference on Object-Oriented Programming, Brussels, Belgium, pp. 186–211, July, 1998.Google Scholar
  22. [Feinberg et al. 97]
    Neal Feinberg, Sonya E. Keene, Robert O. Mathews, and P. Tucker Withington. The Dylan Programming Book. Addison-Wesley Longman, Reading, Mass., 1997.Google Scholar
  23. [Findler & Flatt 98]
    Robert Bruce Findler and Matthew Flatt. Modular Object-Oriented Programming with Units and Mixins. International Conference on Functional Programming, Baltimore, Maryland, September 1998.Google Scholar
  24. [Flatt et al. 98]
    Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and Mixins. Conference Record of POPL’ 98: The 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, California, pp. 171–183. ACM, New York, January 1998.CrossRefGoogle Scholar
  25. [Gamma et al. 95]
    Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, Mass., 1995.Google Scholar
  26. [Gosling et al. 96]
    James Gosling, Bill Joy, Guy Steele, Guy L. Steele. The Java Language Specification. Addison-Wesley, Reading, Mass., 1996.zbMATHGoogle Scholar
  27. [Kiczales et al. 97]
    Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, John Irwin. Aspect-Oriented Programming. In proceedings of the Eleventh European Conference on Object-Oriented Programming, Finland. Springer-Verlag LNCS 1241. June 1997.Google Scholar
  28. [LaLonde et al. 86]
    Wilf R. LaLonde, Dave A. Thomas, and John R. Pugh. An Exemplar Based Smalltalk. OOPSLA’ 86 Conference Proceedings, pp. 322–330, Portland, OR, September, 1986. Published as SIGPLAN Notices 21(11), November, 1986.Google Scholar
  29. [Leavens & Millstein 98]
    Gary T. Leavens and Todd D. Millstein. Multiple Dispatch as Dispatch on Tuples. Conference on Object-oriented Programming, Systems, Languages, and Applications, Vancouver, British Columbia, October 1998.Google Scholar
  30. [Lieberman 86]
    Henry Lieberman. Using Prototypical Objects to Implement Shared Behavior in Object-Oriented Systems. OOPSLA’ 86 Conference Proceedings, pp. 214–223, Portland, OR, September, 1986. Published as SIGPLAN Notices 21(11), November, 1986.MathSciNetGoogle Scholar
  31. [Millstein & Chambers 99]
    Todd Millstein and Craig Chambers. Modular Statically Typed Multimethods. Technical Report UW-CSE-99-03-02, Department of Computer Science and Engineering, University of Washington, March 1999.Google Scholar
  32. [Mugridge et al. 91]
    W. B. Mugridge, J. Hamer, and J. G. Hosking. Multi-Methods in a Statically-Typed Programming Language. ECOOP’ 91 Conference Proceedings, Geneva, Switzerland, July, 1991, volume 512 of Lecture Notes in Computer Science; Springer-Verlag, New York, 1991.CrossRefGoogle Scholar
  33. [Odersky & Wadler 97]
    Martin Odersky and Philip Wadler. Pizza into Java: Translating Theory into Practice. Conference Record of POPL’ 97: The 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, pp. 146–159. ACM, New York, January 1997.Google Scholar
  34. [Paepcke 93]
    Andreas Paepcke. Object-Oriented Programming: The CLOS Perspective. MIT Press, 1993.Google Scholar
  35. [Reenskaug et al. 92]
    T. Reenskaug, E. Anderson, A. Berre, A. Hurlen, A. Landmark, O. Lehne, E. Nordhagen, E. Ness-Ulseth, G. Oftedal, A. Skaar, and P. Stenslet. OORASS: Seamless Support for the Creation and Maintenance of Object-Oriented Systems. Journal of Object-Oriented Programming, 5(6): October 1992, pp. 27–41.Google Scholar
  36. [Reynolds 80]
    John C. Reynolds. Using Category Theory to Design Implicit Conversions and Generic Operators. Semantics-Directed Compiler Generation, Aarhus, Denmark, pp. 211–258. Volume 94 of Lecture Notes in Computer Science, Springer-Verlag, NY, 1980.Google Scholar
  37. [Shalit 97]
    Andrew Shalit. The Dylan Reference Manual: The Definitive Guide to the New Object-Oriented Dynamic Language. Addison-Wesley, Reading, Mass., 1997.Google Scholar
  38. [Smaragdakis & Batory 98]
    Yannis Smaragdakis and Don Batory. Implementing Layered Designs with Mixin Layers. Twelfth European Conference on Object-Oriented Programming, Brussels, Belgium, pp. 550–570, July 1998.Google Scholar
  39. [Steele 90]
    Guy L. Steele Jr. Common Lisp: The Language (second edition). Digital Press, Bedford, MA, 1990.zbMATHGoogle Scholar
  40. [Ungar & Smith 87]
    David Ungar and Randall B. Smith. Self: The Power of Simplicity. OOPSLA’ 87 Conference Proceedings, Orlando, Florida, volume 22, number 12, of ACM SIGPLAN Notices, pp. 227–241. ACM, New York, December, 1987.CrossRefGoogle Scholar
  41. [VanHilst & Notkin 96]
    M. VanHilst and D. Notkin. Using C++ Templates to Implement Role-Based Designs. JSSST International Symposium on Object Technologies for Advanced Software, Springer-Verlag, 1996, pp. 22–37.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Todd Millstein
    • 1
  • Craig Chambers
    • 1
  1. 1.Department of Computer Science and EngineeringUniversity of WashingtonUSA

Personalised recommendations