A Type System for Reflective Program Generators

  • Conference paper
Generative Programming and Component Engineering (GPCE 2005)

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

Abstract

In this paper we describe a type system for a generative mechanism that generalizes the concept of generic types by combining it with a controlled form of reflection. This mechanism makes many code generation tasks possible for which generic types alone would be insufficient. The power of code generation features are carefully balanced with their safety, so that we are able to perform static type checks on generator code. This leads to a generalized notion of type safety for generators.

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

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
EUR 29.95
Price includes VAT (Germany)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
EUR 42.79
Price includes VAT (Germany)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
EUR 53.49
Price includes VAT (Germany)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free ship** 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.

Similar content being viewed by others

References

  1. Draheim, D., Weber, G.: Form-Oriented Analysis - A New Methodology to Model Form-Based Applications. Springer, Heidelberg (2004)

    Google Scholar 

  2. Draheim, D., Lutteroth, C., Weber, G.: Factory: Statically Type-Safe Integration of Genericity and Reflection. In: Proceedings of the 4th International Conference on Software Engineering, Artificial Intelligence, Networking, and Parallel/Distributed Computing, ACIS (2003)

    Google Scholar 

  3. Draheim, D., Lutteroth, C., Weber, G.: Integrating Code Generators into the C# Language. In: Proceedings of ICITA 2005: The 3rd International Conference on Information Technology and Applications. IEEE Press, Los Alamitos (2005) (to appear)

    Google Scholar 

  4. Draheim, D., Lutteroth, C., Weber, G.: Generative Programming for C#. ACM SIGPLAN Notices (2005) (to appear)

    Google Scholar 

  5. Kiczales, G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 18–22. Springer, Heidelberg (2001)

    Google Scholar 

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

    Google Scholar 

  7. Kohlbecker, E., Friedman, D., Felleisen, M., Duba, B.: Hygienic Macro Expansion. In: Gabriel, R. (ed.) Proceedings of the ACM SIGPLAN Conference on LISP and Functional Programming, pp. 151–181. ACM Press, New York (1986)

    Google Scholar 

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

    Google Scholar 

  9. Gabriel, R.G., Bobrow, D.G.: Object Oriented Programming - The CLOS perspective. The MIT Press, Cambridge (1993)

    Google Scholar 

  10. Chiba, S.: A Metaobject Protocol for C++. In: OOPSLA 1995 - Proceedings of the 10 th Conference on Object-Oriented Programming Systems, Languages and Programming. SIGPLAN Notices, pp. 285–299. ACM Press, New York (1995)

    Google Scholar 

  11. Nizhegorodov, D.: Jasper: Type-Safe MOP-Based Language Extensions and Reflective Template Processing in Java. In: Proceedings of ECOOP 2000 Workshop on Reflection and Metalevel Architectures: State of the Art, and Future Trends. ACM Press, New York (2000)

    Google Scholar 

  12. Cardelli, L.: Type Systems. In: Handbook of Computer Science and Engineering. CRC Press, Boca Raton (1997)

    Google Scholar 

  13. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the Java programming language. In: OOPSLA 1998 - Conference on Object-Oriented Programming Systems, Languages, and Applications. SIGPLAN Notices, pp. 183–200. ACM Press, New York (1998)

    Chapter  Google Scholar 

  14. Bracha, G., Cohen, N., Kemper, C., Marx, S., Odersky, M., Panitz, S.E., Stoutamire, D., Thorup, K., Wadler, P.: Adding Generics to the Java Programming Language: Participant Draft Specification. Technical report, SUN Microsystems Ltd. (2001)

    Google Scholar 

  15. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    Google Scholar 

  16. Siek, J., Lumsdaine, A.: Concept Checking: Binding Parametric Polymorphism in C++. In: First Workshop on C++ Template Programming, NETOBJECTDAYS 2000 (October 2000)

    Google Scholar 

  17. McNamara, B., Smaragdakis, Y.: Static Interfaces in C++. In: First Workshop on C++ Template Programming, NETOBJECTDAYS 2000 (2000)

    Google Scholar 

  18. Zólyomi, I., Porkoláb, Z.: Towards a General Template Introspection Library. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 266–282. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  19. Attardi, G., Cisternino, A.: Reflection Support by Means of Template Metaprogramming. In: Bosch, J. (ed.) GCSE 2001. LNCS, vol. 2186, pp. 118–127. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  20. Attardi, G., Cisternino, A.: Template Metaprogramming an Object Interface to Relational Tables. In: Yonezawa, A., Matsuoka, S. (eds.) Reflection 2001. LNCS, vol. 2192, p. 266. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  21. Smith, D.R.: A Generative Approach to Aspect-Oriented Programming. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 39–54. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  22. Paige, R., Koenig, S.: Finite Differencing of Computable Expressions. ACM Trans. Program. Lang. Syst. 4(3), 402–454 (1982)

    Article  MATH  Google Scholar 

  23. Smith, B.C.: Reflection and semantics in LISP. In: POPL 1984: Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pp. 23–35. ACM Press, New York (1984)

    Chapter  Google Scholar 

  24. Hinze, R., Jeuring, J.: Generic Haskell: Practice and Theory. In: Backhouse, R., Gibbons, J. (eds.) Generic Programming. LNCS, vol. 2793, pp. 1–56. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  25. Hinze, R., Jeuring, J.: Generic Haskell: Applications. In: Backhouse, R., Gibbons, J. (eds.) Generic Programming. LNCS, vol. 2793, pp. 57–96. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  26. Kiczales, G., des Rivières, J.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)

    Google Scholar 

  27. von Dincklage, D.: Making Patterns Explicit with Metaprogramming. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 287–306. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  28. Taha, W., Sheard, T.: Multi-Stage Programming with Explicit Annotations. In: PEPM 1997 - Partial Evaluation and Semantics-Based Program Manipulation. SIPLAN Notices, pp. 203–217. ACM Press, New York (1997)

    Chapter  Google Scholar 

  29. Taha, W., Sheard, T.: MetaML and Multi-stage Programming with Explicit Annotations. Theoretical Computer Science 248, 211–242 (2000)

    Article  MATH  Google Scholar 

  30. Leroy, X., Doligez, D., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system release 3.08 - Documentation and user’s manual. Technical report, Institut National de Recherche en Informatique et en Automatique (2004)

    Google Scholar 

  31. Neverov, G., Roe, P.: Metaphor: A Multi-stage, Object-Oriented Programming Language. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 168–185. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  32. Draheim, D., Lutteroth, C., Weber, G.: An Analytical Comparison of Generative Programming Technologies. Technical Report B-04-02, Institute of Computer Science, Freie Universität Berlin (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Draheim, D., Lutteroth, C., Weber, G. (2005). A Type System for Reflective Program Generators. In: Glück, R., Lowry, M. (eds) Generative Programming and Component Engineering. GPCE 2005. Lecture Notes in Computer Science, vol 3676. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11561347_22

Download citation

  • DOI: https://doi.org/10.1007/11561347_22

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29138-1

  • Online ISBN: 978-3-540-31977-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics

Navigation