skip to main content
10.1145/949344.949350acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

The power of symmetry: unifying inheritance and generative programming

Published:26 October 2003Publication History

ABSTRACT

I present the Ohmu language, a unified object model which allows a number of "advanced" techniques such as aspects, mixin layers, parametric polymorphism, and generative components to be implemented cleanly using two basic concepts: block structure and inheritance. I argue that conventional ways of defining classes and objects have created artificial distinctions which limit their expressiveness. The Ohmu model unifies functions, classes, instances, templates, and even aspects into a single construct - the structure. Function calls, instantiation, aspect-weaving, and inheritance are likewise unified into a single operation - the structure transformation. This simplification eliminates the distinction between classes and instances, and between compile-time and run-time code. Instead of being compiled, programs are reduced using partial evaluation, during which the interpreter is invoked at compile-time. Within this architecture, standard OO inheritance becomes a natural vehicle for creating meta-programs and automatic code generators - the key to a number of recent domain-driven programming methodologies.

References

  1. D. Batory, B. Lofaso, and Y. Smaragdakis, JTS: Tools for Implementing Domain-Specific Languages. 5th International Conference on Software Reuse, Victoria, Canada, June 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Don Batory and Sean O'Malley. The Design and Implementation of Hierarchical Software Systems with Reusable Components. ACM Transactions on Software Engineering and Methodology, 1(4):355--398, October 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L.M.J. Bergmans. Composing Concurrent Objects - Applying Composition Filters for the development and Reuse of Concurrent Object-Oriented Programs. Ph.D. Thesis, Department of Computer Science, University of Twente, The Netherlands, 1994.]]Google ScholarGoogle Scholar
  4. G. Bracha and W. Cook. Mixin-Based Inheritance. Joint ACM Conference on OOPSLA and ECOOP, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Gilad Bracha, Martin Odersky, David Stoutamire, and Philip Wadler. Making the Future Safe for the Past, Adding Genericity to the Java Programming Language. Proceedings of OOPSLA '98.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Guiseppe Castagna. Covariance and Contravariance: Conflict Without a Cause. ACM Transactions on Programming Languages and Systems, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Shigeru Chiba. A Meta-Object Protocol for C++. Proceedings of OOPSLA '95.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. K. Czarnecki and U. Eisenecker. Generative Programming: Methods, Techniques, and Applications. Addison-Wesley, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and Mixins. ACM Symposium on Principles of Programming Languages, pages 171--183, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, Grady Booch. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Mass. 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Atsushi Igarashi and Benjamin Pierce. Foundations for virtual types. Technical report, University of Pennsylvania, 1998.]]Google ScholarGoogle Scholar
  12. Neil Jones, Carsten Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. Proceedings of ECOOP, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Kiczales, J. des Rivieres, and D. G. Bobrow. The Art of the Metaobject Protocol. The MIT Press, Cambridge, MA, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. O.L. Madsen and B. Muller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. Proceedings of OOPSLA '89.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Gail Murphy and David Notkin. The Interaction Between Static Typing and Frameworks. Technical Report TR-93-09-02, University of Washington, 1993. See also: The Use of Static Typing to Support Operations on Frameworks. Object-Oriented Systems 3, 1996, pp. 197--213.]]Google ScholarGoogle Scholar
  17. Klaus Ostermann. Dynamically composable collaborations with delegation layers. Proceedings of ECOOP 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Simonyi, .The Death of Computer Languages, the Birth of Intentional Programming. NATO Science Committee Conference, 1995.]]Google ScholarGoogle Scholar
  19. Yannis Smaragdakis and Don Batory. Implementing Layered Designs with Mixin Layers. Proceedings of ECOOP, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. K. K. Thorup and M. Torgersen. Unifying Genericity - Combining the Benefits of Virtual Types and Parameterized Classes. Proceedings of ECOOP, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. David Ungar and Randall B. Smith. Self, The Power of Simplicity. Proceedings of OOPSLA 1987]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. T.L Veldhuizen. Arrays in Blitz++. Proceedings of the 2nd International Scientific Computing in Object Oriented Parallel Environments (ISCOPE'98). See also http://www.oonumerics.org/blitz.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The power of symmetry: unifying inheritance and generative programming

                      Recommendations

                      Reviews

                      Olivier Louis Marie Lecarme

                      The author describes a programming language, Ohmu, as well as an object-oriented (OO) model of the same name, which unifies the concepts of functions, classes, instances, templates, and aspects into a single construct, the structure. If one considers that the first idea of OO languages was to extend and generalize the idea of a structure, this is a fortunate simplification. What I find to be the most interesting idea is that by choosing various binding times for parameters, one can specialize constructs in various ways, and obtain the same capabilities that are currently obtained using many different and restricted constructs. One of the consequences is that the programmer no longer needs to know what is done at compile time and what is done at runtime. Another one is a generalization of the type concept, which finally encompasses objects and values. In fact, if the paper had not been presented to OOPSLA, it could have avoided using the full range of OO terminology. That would make it more acceptable outside of this community. It could be interesting also to note that some of the ideas presented here could be traced back, for example, to the Euler language [1] in 1966, as well as other languages of the same period. But none of the references in this paper is older than 1987. Online Computing Reviews Service

                      Access critical reviews of Computing literature here

                      Become a reviewer for Computing Reviews.

                      Comments

                      Login options

                      Check if you have access through your login credentials or your institution to get full access on this article.

                      Sign in

                      PDF Format

                      View or Download as a PDF file.

                      PDF

                      eReader

                      View online with eReader.

                      eReader