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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Draheim, D., Weber, G.: Form-Oriented Analysis - A New Methodology to Model Form-Based Applications. Springer, Heidelberg (2004)
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)
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)
Draheim, D., Lutteroth, C., Weber, G.: Generative Programming for C#. ACM SIGPLAN Notices (2005) (to appear)
Kiczales, G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 18–22. Springer, Heidelberg (2001)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)
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)
Czarnecki, K., Eisenecker, U.: Generative Programming - Methods, Tools, and Applications. Addison-Wesley, Reading (2000)
Gabriel, R.G., Bobrow, D.G.: Object Oriented Programming - The CLOS perspective. The MIT Press, Cambridge (1993)
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)
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)
Cardelli, L.: Type Systems. In: Handbook of Computer Science and Engineering. CRC Press, Boca Raton (1997)
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)
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)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Siek, J., Lumsdaine, A.: Concept Checking: Binding Parametric Polymorphism in C++. In: First Workshop on C++ Template Programming, NETOBJECTDAYS 2000 (October 2000)
McNamara, B., Smaragdakis, Y.: Static Interfaces in C++. In: First Workshop on C++ Template Programming, NETOBJECTDAYS 2000 (2000)
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)
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)
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)
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)
Paige, R., Koenig, S.: Finite Differencing of Computable Expressions. ACM Trans. Program. Lang. Syst. 4(3), 402–454 (1982)
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)
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)
Hinze, R., Jeuring, J.: Generic Haskell: Applications. In: Backhouse, R., Gibbons, J. (eds.) Generic Programming. LNCS, vol. 2793, pp. 57–96. Springer, Heidelberg (2003)
Kiczales, G., des Rivières, J.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)
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)
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)
Taha, W., Sheard, T.: MetaML and Multi-stage Programming with Explicit Annotations. Theoretical Computer Science 248, 211–242 (2000)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)