Skip to main content

A Unification of Inheritance and Automatic Program Specialization

  • Conference paper
Book cover Generative Programming and Component Engineering (GPCE 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3286))

  • 324 Accesses

Abstract

The object-oriented style of programming facilitates program adaptation and enhances program genericness, but at the expense of efficiency. Automatic program specialization can be used to generate specialized, efficient implementations for specific scenarios, but requires the program to be structured appropriately for specialization and is yet another new concept for the programmer to understand and apply. We have unified automatic program specialization and inheritance into a single concept, and implemented this approach in a modified version of Java named JUST. When programming in JUST, inheritance is used to control the automatic application of program specialization to class members during compilation to obtain an efficient implementation.

This paper presents the language JUST, which integrates object-oriented concepts, block structure, and techniques from automatic program specialization to provide both a generative programming language where object-oriented designs can be efficiently implemented and a simple yet powerful automatic program specializer for an object-oriented language.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. Affeldt, R., Masuhara, H., Sumii, E., Yonezawa, A.: Supporting objects in runtime bytecode specialization. In: Proceedings of the ASIAN symposium on Partial evaluation and semantics-based program manipulation, pp. 50–60. ACM Press, New York (2002)

    Chapter  Google Scholar 

  2. Andersen, H.M., Schultz, U.P.: Declarative specialization for object-orientedprogram specialization. In: ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 2004), ACM Press, New York (2004) (to appear)

    Google Scholar 

  3. Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, Computer Science Department, University of Copenhagen, DIKU Technical Report 94/19 (May 1994)

    Google Scholar 

  4. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: adding genericity to the java programming language. In: Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 183–200. ACM Press, New York (1998)

    Chapter  Google Scholar 

  5. Braux, M., Noyé, J.: Towards partially evaluating reflection in Java. In: ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 2000), Boston, MA, USA, January 2000, ACM Press, New York (2000)

    Google Scholar 

  6. Cardelli, L.: Structural subtyping and the notion of power type. In: Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, San Diego, California, pp. 70–79 (1988)

    Google Scholar 

  7. Chambers, C., Ungar, D.: Customization: Optimizing compiler technology for SELF, A dynamically-typed object-oriented programming language. In: Knobe, B. (ed.) Proceedings of the SIGPLAN 1989 Conference on Programming Language Design and Implementation (PLDI 1989), Portland, OR, USA, June 1989, pp. 146–160. ACM Press, New York (1989)

    Chapter  Google Scholar 

  8. Chepovsky, A.M., Klimov, A.V., Klimov, A.V., Klimov, Y.A., Mishchenko, A.S., Romanenko, S.A., Skorobogatov, S.Y.: Partial evaluation for common intermediate language. In: Broy, M., Zamulin, A.V. (eds.) PSI 2003. LNCS, vol. 2890, pp. 171–177. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  9. Consel, C., Hornof, L., Noël, F., Noyé, J., Volanschi, E.N.: A uniform approach for compile-time and run-time specialization. In: Danvy et al: [11], pp. 54–72

    Google Scholar 

  10. Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  11. Danvy, O., Thiemann, P., Glück, R. (eds.): Dagstuhl Seminar 1996. LNCS, vol. 1110. Springer, Heidelberg (1996)

    Google Scholar 

  12. Dean, J., Chambers, C., Grove, D.: Selective specialization for object-oriented languages. In: Proceedings of the ACM SIGPLAN 1995 Conference on Programming Language Design and Implementation (PLDI 1995), La Jolla, CA USA, June 1995. ACM SIGPLAN Notices, vol. 30(6), pp. 93–102. ACM Press, New York (1995)

    Chapter  Google Scholar 

  13. Dussart, D., Hughes, J., Thiemann, P.: Type specialisation for imperative languages. In: Proceedings of the second ACM SIGPLAN international conference on Functional programming, pp. 204–216. ACM Press, New York (1997)

    Chapter  Google Scholar 

  14. Ernst, E.: Propagating class and method combination. In: [17], Guerraoui, pp. 67–91

    Google Scholar 

  15. Fujinami, N.: Determination of dynamic method dispatches using run-time code generation. In: Leroy, X., Ohori, A. (eds.) TIC 1998. LNCS, vol. 1473, pp. 253–271. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  16. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1994)

    Google Scholar 

  17. Guerraoui, R. (ed.): Proceedings of the European Conference on Object-oriented Programming (ECOOP 1999), Lisbon, Portugal, June 1999. LNCS, vol. 1628. Springer, Heidelberg (1999)

    Google Scholar 

  18. Hughes, J.: Type specialisation for the λ-calculus or a new paradigm for partial evaluation based on type inference. In: Danvy et al.: [11], pp. 183–215

    Google Scholar 

  19. Hutchins, D.: The power of symmetry: unifying inheritance and generative programming. In: Companion of the 18th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 38–52. ACM Press, New York (2003)

    Chapter  Google Scholar 

  20. Igarashi, A., Viroli, M.: On variance-based subtyping for parametric types. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 441–469. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  21. Jones, N.D., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation, June 1993. International Series in Computer Science. Prentice-Hall, Englewood Cliffs (1993)

    MATH  Google Scholar 

  22. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C.V., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  23. Luján, M.: Object oriented linear algebra. Master’s thesis, University of Manchester (December 1999)

    Google Scholar 

  24. Luján, M., Freeman, T.L., Gurd, J.R.: OoLaLa: an object oriented analysis and design of numerical linear algebra. In: Rosson, M.B., Lea, D. (eds.) OOPSLA 2000 Conference Proceedings, ACM SIGPLAN Notices, Minneapolis, MN USA, October 2000, pp. 229–252. ACM Press, Minneapolis (2000)

    Google Scholar 

  25. Madsen, O.L.: Open issues in object-oriented programming – a scandinavian perspective. SOFTWARE. Practice and Experience 25(4) (December 1995)

    Google Scholar 

  26. Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Object-oriented programming in the Beta programming language. Addison-Wesley, Reading (1993)

    Google Scholar 

  27. Madsen, O.L., Pedersen, B.M.: Virtual classes: a powerful mechanism in objectoriented programming. In: Conference proceedings on Object-oriented programming systems, languages and applications (OOPSLA 1989), New Orleans, Louisiana, United States. SIGPLAN Notices, vol. 24(10), pp. 397–406. ACM Press, New Orleans (1989)

    Chapter  Google Scholar 

  28. Meyer, B.: Eiffel: The language. Object-Oriented Series. Prentice Hall, New York (1992)

    MATH  Google Scholar 

  29. Schultz, U.P.: Object-Oriented Software Engineering Using Partial Evaluation. PhD thesis, University of Rennes I, Rennes, France (December 2000)

    Google Scholar 

  30. Schultz, U.P.: Partial evaluation for class-based object-oriented languages. In: Danvy, O., Filinski, A. (eds.) PADO 2001. LNCS, vol. 2053, pp. 173–197. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  31. Schultz, U.P., Lawall, J., Consel, C., Muller, G.: Towards automatic specialization of Java programs. In: Guerraoui [17], pp. 367–390

    Google Scholar 

  32. Schultz, U.P., Lawall, J.L., Consel, C.: Automatic program specialization for Java. TOPLAS 25, 452–499 (2003)

    Article  Google Scholar 

  33. Thibault, S., Consel, C., Marlet, R., Muller, G., Lawall, J.: Static and dynamic program compilation by interpreter specialization. Higher-Order and Symbolic Computation (HOSC) 13(3), 161–178 (2000)

    Article  MATH  Google Scholar 

  34. Thorup, K.K., Torgersen, M.: Unifying genericity – combining the benefits of virtual types and parameterized classes. In: Guerraoui [17]

    Google Scholar 

  35. Torgersen, M.: Virtual types are statically safe. In: 5th Workshop on Foundations of Object-Oriented Languages (January 1998)

    Google Scholar 

  36. Torgersen, M., Hansen, C.P., Ernst, E., von der Ahé, P., Bracha, G., Gafter, N.: Adding wildcards to the Java programming language. In: Proceedings of the 2004 ACM symposium on Applied computing, pp. 1289–1296. ACM Press, New York (2004)

    Chapter  Google Scholar 

  37. Veldhuizen, T.L.: C++ templates as partial evaluation. In: ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM 1998), San Antonio, TX, USA, January 1999, pp. 13–18. ACM Press, San Antonio (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Schultz, U.P. (2004). A Unification of Inheritance and Automatic Program Specialization. In: Karsai, G., Visser, E. (eds) Generative Programming and Component Engineering. GPCE 2004. Lecture Notes in Computer Science, vol 3286. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30175-2_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30175-2_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23580-4

  • Online ISBN: 978-3-540-30175-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics