Generative Programming and Active Libraries

Extended Abstract
  • Krzysztof Czarnecki
  • Ulrich Eisenecker
  • Robert Glück
  • David Vandevoorde
  • Todd Veldhuizen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1766)


We describe generative programming, an approach to generating customized programming components or systems, and active libraries, which are based on this approach. In contrast to conventional libraries, active libraries may contain metaprograms that implement domain-specific code generation, optimizations, debugging, profiling and testing. Several working examples (Blitz++, GMCL, Xroma) are presented to illustrate the potential of active libraries. We discuss relevant implementation technologies.


Generative Programming Partial Evaluation Syntax Tree Expression Template Standard Template Library 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    D. Bjørner, A. P. Ershov, and N. D. Jones, editors. Partial Evaluation and Mixed Computation. North-Holland, Amsterdam, 1988.Google Scholar
  2. 2.
    S. Chiba. A Metaobject Protocol for C++. In OOPSLA’95, pages 285–299, 1995.Google Scholar
  3. 3.
    C. Consel, L. Hornof, F. Nöel, J. Noyé, and E. N. Volanschi. A uniform approach for compile-time and run-time specialization. In R. Glück, and P. Thiemann, editors. Partial Evaluation, volume 1110 of Lecture Notes in Computer Science. Springer-Verlag, 1996 Danvy et al. [8], pages 54–72.CrossRefGoogle Scholar
  4. 4.
    K. Czarnecki. Generative Programming: Principles and Techniques of Software Engineering Based on Automated Configuration and Fragment-Based Component Models. PhD Thesis. Technical University of Ilmenau, Ilmenau, 1998.Google Scholar
  5. 5.
    K. Czarnecki and U. Eisenecker. Meta-control structures for template metaprogramming.
  6. 6.
    K. Czarnecki and U. Eisenecker. Components and generative programming. In O. Nierstrasz, editor, Proceedings of the Joint European Software Engineering Conference and ACM SIGSOFT International Symposium on the Foundations of Software Engineering (ESEC/FSE 99, Toulouse, Frankreich, September 1999). Springer-Verlag, 1999.Google Scholar
  7. 7.
    K. Czarnecki and U. Eisenecker. Generative Programming: Methods, Techniques and Applications. Addison-Wesley Longman, 1999. (to appear).Google Scholar
  8. 8.
    O. Danvy, R. Glück, and P. Thiemann, editors. Partial Evaluation, volume 1110 of Lecture Notes in Computer Science. Springer-Verlag, 1996.zbMATHGoogle Scholar
  9. 9.
    U. Eisenecker. Generative Programming (GP) with C++. In H. Mössenböck, editor, Modular Programming Languages, volume 1024, pages 351–365. Springer-Verlag, 1997.Google Scholar
  10. 10.
    D. R. Engler. Incorporating application semantics and control into compilation. In USENIX Conference on Domain-Specific Languages (DSL’97), October 15–17, 1997.Google Scholar
  11. 11.
    D. R. Engler, W. C. Hsieh, and M. F. Kaashoek. ‘C: A language for high-level, efficient, and machine-independent dynamic code generation. In POPL’96, pages 131–144, 1996.Google Scholar
  12. 12.
    A. P. Ershov. On the essence of compilation. In E. J. Neuhold, editor, Formal Description of Programming Concepts, pages 391–420. North-Holland, 1978.Google Scholar
  13. 13.
    Y. Futamura. Partial evaluation of computation process-an approach to a compiler-compiler. Systems, Computers, Controls, 2(5):45–50, 1971.Google Scholar
  14. 14.
    Y. Futamura. Partial computation of programs. In E. Goto, K. Furukawa, R. Nakajima, I. Nakata, and A. Yonezawa, editors, RIMS Symposia on Software Science and Engineering, volume 147 of Lecture Notes in Computer Science, pages 1–35, Kyoto, Japan, 1983. Springer-Verlag.CrossRefGoogle Scholar
  15. 15.
    R. Glück and J. Jørgensen. An automatic program generator for multi-level specialization. Lisp and Symbolic Computation, 10(2):113–158, 1997.CrossRefGoogle Scholar
  16. 16.
    R. Glück and A. V. Klimov. Metacomputation as a tool for formal linguistic modeling. In R. Trappl, editor, Cybernetics and Systems’ 94, volume 2, pages 1563–1570, Singapore, 1994. World Scientific.Google Scholar
  17. 17.
    B. Grant, M. Mock, M. Philipose, C. Chambers, and S. J. Eggers. Annotation-directed run-time specialization in C. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’97), pages 163–178. ACM, June 1997.Google Scholar
  18. 18.
    P. Hudak. Building domain-specific embedded languages. ACM Computing Surveys, 28(4es):196–196, Dec. 1996.CrossRefGoogle Scholar
  19. 19.
    Y. Ishikawa, A. Hori, M. Sato, M. Matsuda, J. Nolte, H. Tezuka, H. Konaka, M. Maeda, and K. Kubota. Design and implementation of metalevel architecture in C++ — MPC++ approach. In Reflection’96, 1996.Google Scholar
  20. 20.
    N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International, International Series in Computer Science, June 1993. ISBN number 0-13-020249-5 (pbk).Google Scholar
  21. 21.
    G. Kiczales and et al. Home page of the Aspect-Oriented Programming Project.
  22. 22.
    M. Leone and P. Lee. Lightweight run-time code generation. In Proceedings of the 1994 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 97–106. Technical Report 94/9, Department of Computer Science, University of Melbourne, June 1994.Google Scholar
  23. 23.
    R. Marlet, S. Thibault, and C. Consel. Mapping software architectures to efficient implementations via partial evaluation. In Conference on Automated Software Engineering, pages 183–192, Lake Tahoe, Nevada, 1997. IEEE Computer Society.Google Scholar
  24. 24.
    D. Musser and A. Saini. STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library. Addison-Wesley, Reading (MA), USA, 1996.Google Scholar
  25. 25.
    T. Neubert. Anwendung von generativen Programmiertechniken am Beispiel der Matrixalgebra. Technische Universitet Chemnitz, 1998. Diplomarbeit.Google Scholar
  26. 26.
    M. Poletto, D. R. Engler, and M. F. Kaashoek. tcc: A system for fast, flexible, and high-level dynamic code generation. In PLDI’97, 1996.Google Scholar
  27. 27.
    S. Shende, A. D. Malony, J. Cuny, K. Lindlan, P. Beckman, and S. Karmesin. Portable profiling and tracing for parallel, scientific applications using C++. In Proceedings of SPDT’98: ACM SIGMETRICS Symposium on Parallel and Distributed Tools, pages 134–145, August, 1998.Google Scholar
  28. 28.
    J. G. Siek and A. Lumsdaine. Modern Software Tools in Scientific Computing, chapter A Modern Framework for Portable High Performance Numerical Linear Algebra. Birkhauser, 1999.Google Scholar
  29. 29.
    C. Simonyi and et. al. Home page of the Intentional Programming Project.
  30. 30.
    J. Stichnoth and T. Gross. Code composition as an implementation language for compilers. In USENIX Conference on Domain-Specific Languages, 1997.Google Scholar
  31. 31.
    W. Taha, Z.-E.-A. Benaissa, and T. Sheard. Multi-stage programming: axiomatization and type-safety. In International Colloquium on Automata, Languages, and Programming, Lecture Notes in Computer Science, Aalborg, Denmark, 1998. Springer-Verlag.Google Scholar
  32. 32.
    V. F. Turchin. The concept of a supercompiler. ACM TOPLAS, 8(3):292–325, 1986.MathSciNetCrossRefzbMATHGoogle Scholar
  33. 33.
    T. L. Veldhuizen. Expression templates. C++ Report, 7(5):26–31, June 1995. Reprinted in C++ Gems, ed. Stanley Lippman.Google Scholar
  34. 34.
    T. L. Veldhuizen. Using C++ template metaprograms. C++ Report, 7(4):36–43, May 1995. Reprinted in C++ Gems, ed. Stanley Lippman.Google Scholar
  35. 35.
    T. L. Veldhuizen. Arrays in Blitz++. In ISCOPE’98, volume 1505 of Lecture Notes in Computer Science, 1998.Google Scholar
  36. 36.
    P. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.MathSciNetCrossRefzbMATHGoogle Scholar
  37. 37.
    E. Willink and V. Muchnick. Weaving a way past the C++ One Definition Rule. Position Paper for the Aspect Oriented Programming Workshop at ECOOP 99, Lisbon, June 14, 1999. Available at

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Krzysztof Czarnecki
    • 1
  • Ulrich Eisenecker
    • 2
  • Robert Glück
    • 3
  • David Vandevoorde
    • 4
  • Todd Veldhuizen
    • 5
  1. 1.Research and TechnologyDaimlerChrysler AGUlm
  2. 2.Fachhochschule HeidelbergHeidelberg
  3. 3.Dept. of Computer ScienceUniversity of CopenhagenCopenhagen
  4. 4.Edison Design GroupUSA
  5. 5.Computer Science Dept.Indiana UniversityUSA

Personalised recommendations