Abstract
Program generation is among the most promising techniques in the effort to increase the automation of programming tasks. In this talk, we discuss the potential impact and research value of program generation, we give examples of our research in the area, and we outline a future work direction that we consider most interesting.
Specifically, we first discuss why program generators have significant applied potential. We believe that program generators can be made easy-to-implement so that they are competitive with traditional software libraries in many software domains. Compared to a common library, a generator implementing a domain-specific language can offer more concise syntax, better static error checking, and better performance through cross-operation optimizations.
Despite the significant applied value of generators, however, we argue that meta-programming tools (i.e., language tools for writing program generators) may be of greater value as a research topic. The reason has to do with the domain-specificity of generators. The value of a program generator is often tied so closely to a software domain that there is little general and reusable knowledge to transmit to other generator researchers. We discuss meta-programming tools as an area with both interesting conceptual problems and great value. A good meta-programming infrastructure can simplify the creation of generators to make them an effective solution for many more domains.
We illustrate our views on generators and meta-programming tools with two artifacts from our latest work: the Meta-AspectJ meta-programming language [6] and the GOTECH generator [5]. Meta-AspectJ enables generating Java and AspectJ programs using code templates, i.e., quote and unquote operators. Meta-AspectJ has two interesting elements. First, we believe that using the AspectJ language as a back-end simplifies the task of writing a generator. The GOTECH generator uses this technique to adapt a Java program for server side execution in a J2EE application server. Second, Meta-AspectJ is a technically mature meta-programming tool – in many respects the most advanced meta-programming tool for Java. For instance, Meta-AspectJ reduces the need to deal with low level syntactic types for quoted entities (e.g., “expression”, “statement”, “identifier”, etc.) through type inference and a context-sensitive parsing algorithm.
Finally, we examine the problem of statically determining the safety of a generator and present its intricacies. We limit our focus to one particular kind of guarantee for generated code: ensuring that the generated program is free of compile-time errors, such as type errors, references to undefined variables, etc. We argue that it is the responsibility of a good meta-programming tool to ensure that the generators written in it will always produce legal programs. Nevertheless, if we do not severely limit the generator, the problem becomes one of arbitrary control- and data-flow analysis. We discuss why the limitations of current meta-programming tools that offer safety guarantees [1,4] are too strict and we present possible avenues for future research.
For further reading, a full paper accompanying this talk can be found in the PEPM’04 proceedings. The reader may also want to consult one of the good surveys on program generation, examining the topic either from an applied perspective [3] or from a partial evaluation perspective [2].
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Calcagno, C., Taha, W., Huang, L., Leroy, X.: Implementing multi-stage languages using ASTs, gensym, and reflection. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 57–76. Springer, Heidelberg (2003)
Jones, N.D., Glenstrup, A.J.: Program generation, termination, and bindingtime analysis. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 1–31. Springer, Heidelberg (2002)
Smaragdakis, Y., Batory, D.: Application generators. In: Webster, J.G. (ed.) Encyclopedia of Electrical and Electronics Engineering, John Wiley and Sons, Chichester (2000)
Taha, W., Sheard, T.: Multi-stage programming with explicit annotations. In: Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997, pp. 203–217. ACM, New York (1997)
Tilevich, E., Urbanski, S., Smaragdakis, Y., Fleury, M.: Aspectizing server-side distribution. In: Proceedings of the Automated Software Engineering (ASE) Conference, October 2003, IEEE Press, Los Alamitos (2003)
Zook, D., Huang, S.S., Smaragdakis, Y.: Generating AspectJ programs with Meta-AspectJ. In: Karsai, G., Visser, E. (eds.) GPCE 2004. LNCS, vol. 3286, pp. 1–18. Springer, Heidelberg (2004) (to appear)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Smaragdakis, Y. (2004). Program Generators and the Tools to Make Them. In: Giacobazzi, R. (eds) Static Analysis. SAS 2004. Lecture Notes in Computer Science, vol 3148. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27864-1_3
Download citation
DOI: https://doi.org/10.1007/978-3-540-27864-1_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22791-5
Online ISBN: 978-3-540-27864-1
eBook Packages: Springer Book Archive