Abstract
Meta-AspectJ (MAJ) is a language for generating AspectJ programs using code templates. MAJ itself is an extension of Java, so users can interleave arbitrary Java code with AspectJ code templates. MAJ is a structured metaprogramming tool: a well-typed generator implies a syntactically correct generated program. MAJ promotes a methodology that combines aspect-oriented and generative programming. A valuable application is in implementing small domain-specific language extensions as generators using unobtrusive annotations for syntax extension and AspectJ as a back-end. The advantages of this approach are twofold. First, the generator integrates into an existing software application much as a regular API or library, instead of as a language extension. Second, a mature language implementation is easy to achieve with little effort since AspectJ takes care of the low-level issues of interfacing with the base Java language.
In addition to its practical value, MAJ offers valuable insights to metaprogramming tool designers. It is a mature metaprogramming tool for AspectJ (and, by extension, Java): a lot of emphasis has been placed on context-sensitive parsing and error reporting. As a result, MAJ minimizes the number of metaprogramming (quote/unquote) operators and uses type inference to reduce the need to remember type names for syntactic entities.
- Bachrach, J. and Playford, K. 2001. The Java syntactic extender (JSE). In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). ACM Press, New York, NY, 31--42. Google ScholarDigital Library
- Baker, J. and Hsieh, W. C. 2002. Maya: multiple-dispatch syntax extension in Java. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). ACM Press, New York, NY, 270--281. Google ScholarDigital Library
- Batory, D., Lofaso, B., and Smaragdakis, Y. 1998. JTS: Tools for implementing domain-specific languages. In Proceedings of the IEEE International Conference on Software Reuse (ICSR) (Victoria, B.C., Canada). 143--153. Google ScholarDigital Library
- Batory, D., Sarvela, J. N., and Rauschmayer, A. 2003. Scaling step-wise refinement. In Proceedings of the IEEE International Conference on Software Engineering (ICSE). IEEE Computer Society Press, Los Alamitos, CA, 187--197. Google ScholarDigital Library
- Bracha, G. and Cook, W. 1990. Mixin-based inheritance. In Proceedings of the European Conference on Object-Oriented Programming and Object-Oriented Programming Systems, Languages, and Applications (OOPSLA/ECOOP). ACM Press, New York, NY, 303--311. Google ScholarDigital Library
- Bravenboer, M., Vermaas, R., Vinju, J., and Visser, E. 2005. Generalized type-based disambiguation of meta programs with concrete object syntax. In Generative Programming and Component Engineering (GPCE) Conference, R. Glück and M. Lowry, Eds. Lecture Notes in Computer Science, vol. 3676. Springer, Berlin, Germany, 157--172. Google ScholarDigital Library
- Brichau, J., Mens, K., and Volder, K. D. 2002. Building composable aspect-specific languages. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2487. Springer, Berlin, Germany. Google ScholarDigital Library
- Bryant, A., Catton, A., De Volder, K., and Murphy, G. C. 2002. Explicit programming. In Proceedings of the Conference on Aspect-Oriented Software Development (AOSD). ACM Press, New York, NY, 10--18. Google ScholarDigital Library
- Calcagno, C., Taha, W., Huang, L., and Leroy, X. 2003. Implementing multistage languages using ASTs, gensym, and reflection. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2830. Springer, Berlin, Germany, 57--76. Google ScholarDigital Library
- Chiba, S. 1995. A metaobject protocol for C++. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). SIGPLAN Not. 30, 10, 285--299. Google ScholarDigital Library
- Chiba, S. and Nishizawa, M. 2003. An easy-to-use toolkit for efficient Java bytecode translators. In Generative Programming and Component Engineering (GPCE) Conference. Springer-Verlag, New York, NY, 364--376. Google ScholarDigital Library
- Clinger, W. 1991. Macros that work. In Proceedings of the Conference on Principles of Programming Languages (POPL). ACM Press, New York, NY, 155--162. Google ScholarDigital Library
- Cordy, J. R., Halpern-Hamu, C. D., and Promislow, E. 1991. TXL: A rapid prototyping system for programming language dialects. Comput. Lang. 16, 1, 97--107. Google ScholarDigital Library
- Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., and Black, A. P. 2006. Traits: A mechanism for fine-grained reuse. ACM Trans. Program. Lang. Syst. 28, 2, 331--388. Google ScholarDigital Library
- Gosling, J., Joy, B., Steele, G., and Bracha, G. 2005. The Java Language Specification, 3rd ed. Addison-Wesley, Boston, MA. Google ScholarDigital Library
- Guy L. Steele, J. 1990. Common LISP: The language, 2nd ed. Digital Press, Newton, MA. Google ScholarDigital Library
- Huang, S. S. and Smaragdakis, Y. 2006. Easy language extension with Meta-AspectJ. In Proceedings of the International Conference on Software Engineering, Emerging Results. 865--868. Google ScholarDigital Library
- Huang, S. S., Zook, D., and Smaragdakis, Y. 2005. Statically safe program generation with SafeGen. In Proceedings of the Generative Programming and Component Engineering Conference. 309--326. Google ScholarDigital Library
- Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., and Griswold, W. 2001. Getting started with AspectJ. Commun. ACM 44, 10, 59--65. Google ScholarDigital Library
- Kohlbecker, E., Friedman, D. P., Felleisen, M., and Duba, B. 1986. Hygienic macro expansion. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming. ACM Press, New York, NY, 151--161. Google ScholarDigital Library
- Lohmann, D., Blaschke, G., and Spinczyk, O. 2004. Generic advice: On the combination of AOP with generative programming in AspectC++. In Generative Programming and Component Engineering (GPCE) Conference, G. Karsai and E. Visser, Eds. Lecture Notes in Computer Science, vol. 3286. Springer Verlag, Berlin, Germany, 55--74.Google Scholar
- Mohnen, M. 2002. Interfaces with default implementations in Java. In Principles and Practice of Programming. National University of Ireland, Maynooth, County Kildare, Ireland, Ireland, 35--40. Google ScholarDigital Library
- Parr, T. J. and Quong, R. W. 1995. ANTLR: A predicated LL(k) parser generator. Softw.-Pract. Exp. 25, 7 (July), 789--810. Google ScholarDigital Library
- Rajan, H. and Sullivan, K. 2003. Eos: Instance-level aspects for integrated system design. SIGSOFT Softw. Eng. Notes 28, 5, 297--306. Google ScholarDigital Library
- Sheard, T. and Jones, S. P. 2002. Template metaprogramming for Haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell. ACM Press, New York, NY, 1--16. Google ScholarDigital Library
- Shonle, M., Lieberherr, K., and Shah, A. 2003. Xaspects: An extensible system for domain specific aspect languages. In Proceedings of OOPSLA'2003, Domain-Driven Development Track. Google ScholarDigital Library
- Smaragdakis, Y. 2004. A personal outlook on generator research. In Domain-Specific Program Generation, C. Lengauer, D. Batory, C. Consel, and M. Odersky, Eds. Lecture Notes in Computer Science, vol. 3016, Springer-Verlag, Berlin, Germany.Google Scholar
- Smaragdakis, Y. and Batory, D. 1999. Scoping constructs for program generators. In Proceedings of the Generative and Component-Based Software Engineering Symposium (GCSE). Earlier version in Tech. rep. UTCS-TR-96-37, University of Texas at Austin, Austin, TX. Google ScholarDigital Library
- Soares, S., Laureano, E., and Borba, P. 2002. Implementing distribution and persistence aspects with AspectJ. In Proceedings of the Conferences on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). ACM Press, New York, NY, 174--190. Google ScholarDigital Library
- Taha, W. and Sheard, T. 1997. Multi-stage programming with explicit annotations. In Proceedings of the Conference on Partial Evaluation and Semantics-Based Program Manipulation (Amsterdam, The Netherlands, June). ACM Press, New York, NY, 203--217. Google ScholarDigital Library
- Tilevich, E., Urbanski, S., Smaragdakis, Y., and Fleury, M. 2003. Aspectizing server-side distribution. In Proceedings of the Conference on Automated Software Engineering Conference. IEEE Computer Society Press, Los Alamitos, CA.Google Scholar
- Visser, E. 2002. Metaprogramming with concrete object syntax. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2487. Springer, Berlin, Germany, 299--315. Google ScholarDigital Library
- Volder, K. D. 1998. Type-oriented logic meta programming. Ph.D. dissertation. Vrije Universiteit Brussel, Brussels, Belgium.Google Scholar
- Weise, D. and Crew, R. F. 1993. Programmable syntax macros. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 156--165. Google ScholarDigital Library
- Zook, D., Huang, S. S., and Smaragdakis, Y. 2004. Generating AspectJ programs with meta-AspectJ. In Generative Programming and Component Engineering (GPCE) Conference. Springer-Verlag, Berlin, Germany, 1--18.Google Scholar
Index Terms
- Domain-specific languages and program generation with meta-AspectJ
Recommendations
Easy language extension with meta-aspectJ
ICSE '06: Proceedings of the 28th international conference on Software engineeringDomain-specific languages hold the potential of automating the software development process. Nevertheless, the adoption of a domain-specific language is hindered by the difficulty of transitioning to different language syntax and employing a separate ...
Mixing source and bytecode: a case for compilation by normalization
Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation ...
Incremental concrete syntax for embedded languages
SAC '11: Proceedings of the 2011 ACM Symposium on Applied ComputingEmbedded domain-specific languages (EDSLs) are known to improve the productivity of developers. However, for many domains no DSL implementation is available. Two important reasons are: First, the effort to implement embedded DSLs that provide the domain'...
Comments