Nothing Special   »   [go: up one dir, main page]

skip to main content
article

An integrated implementation framework for compile-time metaprogramming

Published: 01 June 2015 Publication History

Abstract

Compile-time metaprograms are programs executed during the compilation of a source file, usually targeting to update its source code. Even though metaprograms are essentially programs, they are typically treated as exceptional cases without sharing common practices and development tools. Toward this direction, we identify a set of primary requirements related to language implementation, metaprogramming features, software engineering support, and programming environments and elaborate on addressing these requirements in the implementation of a metaprogramming language. In particular, we introduce the notion of integrated compile-time metaprograms, as coherent programs assembled from specific metacode fragments present in the source code. We show the expressiveness of this programming model and illustrate its advantages through various metaprogram scenarios. Additionally, we present an integrated tool chain, supporting full-scale build features and compile-time metaprogram debugging. Copyright © 2013 John Wiley & Sons, Ltd.

References

[1]
Sheard T, Benaissa Z, Martel M. Introduction to Multistage Programming Using MetaML, 2nd edn.Pacific Software Research Center, Oregon Graduate Institute, 2000. Available at: "http://web.cecs.pdx.edu/~sheard/papers/manual.ps". [last accessed 18 October 2013].
[2]
Taha W. A gentle introduction to multi-stage programming. In Domain-Specific Program Generation, Germany, March 2003, Lengauer C, Batory D, Consel C, Odersky M eds. Springer, LNCS 3016, 2004; 30-50. Available at: http://dx.doi.org/10.1007/978-3-540-25935-0_3.
[3]
<author>Taha, W</author>, Sheard T. Multi-stage programming with explicit annotations. In Proceedings of the Symposium on Partial Evaluation and Semantic-Based Program Manipulation PEPM '97, ACM: New York, NY, USA, 1997; 203-217, December 1997, Available at: "http://doi.acm.org/10.1145/258994.259019".
[4]
Sheard T. Using MetaML: a staged programming language. In: Advanced Functional Programming. Springer LNCS 1608, 1998; 207-239. Available at: http://dx.doi.org/10.1007/10704973_5.
[5]
Calcagno C, Taha W, Huang L, Leroy X. A bytecode-compiled, type-safe, multi-stage language, 2001. Available at: "http://www.cs.rice.edu/~taha/publications/preprints/pldi02-pre.pdf". [last accessed 18 October 2013]
[6]
Sheard T, Jones SP. Template metaprogramming for Haskell. SIGPLAN Not. 37, 12, 2002; 60-75, Available at: http://dx.doi.org/10.1145/636517.636528.
[7]
Tratt L. Compile-time meta-programming in a dynamically typed OO language. In Proceedings of the 2005 Symposium on Dynamic Languages DLS '05, RoelWuyts Ed. ACM: New York, USA, 2005; pp.49-63. Available at: "http://doi.acm.org/10.1145/1146841.1146846".
[8]
Tratt L. Domain specific language implementation via compile-time metaprogramming. ACM Transactions on Programming Languages and Systems TOPLAS 2008; Volume 30 Issue 6: pp.1-40. Available at: "http://doi.acm.org/10.1145/1391956.1391958".
[9]
Fleutot F. 2007. Metalua manual. Available at: "http://metalua.luaforge.net/metalua-manual.html". [last accessed 18 October 2013].
[10]
Weise D, Crew R. Programmable syntax macros. In Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation PLDI '93, RobertCartwright Ed. ACM: New York, NY, USA, 1993; 156-165, June 1993, Available at: "http://doi.acm.org/10.1145/155090.155105".
[11]
Bawden A. Quasiquotation in Lisp. In Proceedings of the Workshop on Partial Evaluation and Semantics-Based Program Manipulation, San Antonio. University of Aarhus, Computer Science Department. Invited talk, 1999; pp.88-99. Available at: "http://repository.readscheme.org/ftp/papers/pepm99/bawden.pdf". [last accessed 18 October 2013]
[12]
Sheard T. Accomplishments and research challenges in metaprogramming. In Proceedings of the Second International Workshop on Semantics, Application and Implementation of Program Generation SAIG'01, Florence, Italy, Springer LNCS 2196, 2001; 2-44. Available at: http://dx.doi.org/10.1007/3-540-44806-3_2.
[13]
Seibel P. Practical Common Lisp. Apress, 2005; ISBN 978-1590592397.
[14]
Savidis A. Dynamic imperative languages for runtime extensible semantics and polymorphic meta-programming. In Proceedings of the 2nd International Workshop on Rapid Integration of Software Engineering Techniques RISE 2005, Heraklion, Crete, Greece, Springer LNCS 3943, 2005; 113-128. Available at: http://dx.doi.org/10.1007/11751113_9.
[15]
Savidis A. The Delta programming language. 2010. Available at: "http://www.ics.forth.gr/hci/files/plang/Delta/Delta.html". [last accessed 18 October 2013].
[16]
Stroustrup B. The C++ Programming Language Special Edition. Addison-Wesley, 2000.
[17]
Abrahams D, Gurtovoy A. C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond. Addison-Wesley Professional, 2004.
[18]
Veldhuizen TL. Using C++ template metaprograms. C++ Report 1995; Volume 7 Issue 4: pp.36-43.
[19]
Dybvig RK. The Scheme Programming Language fourth edition. The MIT Press, 2009; ISBN 978-0-262-51298-5 / LOC QA76.73.S34D93.
[20]
Skalski K, Moskal M, Olszta P. 2004. Meta-programming in Nemerle. Available at: "http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.8265&rep=rep1&t%20ype=pdf". [last accessed 18 October 2013].
[21]
Palmer Z, Smith SF. Backstage Java: making a difference in metaprogramming. In Proceedings of the 2011 ACM International Conference on Object-Oriented Programming Systems Languages and Applications, ACM: New York, USA, 2011; 939-958, Available at: "http://doi.acm.org/10.1145/2048066.2048137".
[22]
Kernighan BW, Ritchie DM. The C Programming Language, second edn.Prentice-Hall: Englewood Cliffs, NJ 07632, USA, 1988.
[23]
Kohlbecker E, Friedman DP, Felleisen M, Duba B. Hygienic macro expansion. In Proceedings of the 1986 ACM conference on LISP and functional programming LFP '86, ACM: New York, NY, USA, 1986; 151-161. Available at: "http://doi.acm.org/10.1145/319838.319859".
[24]
Microsoft Corporation. Using IntelliSense. Available at: "http://msdn.microsoft.com/en-us/library/hcw1s69b.aspx". [last accessed 18 October 2013].
[25]
Czarnecki K, John O'Donnell JS, Taha W. DSL implementation in MetaOCaml, Template Haskell, and C++. In Domain-Specific Program Generation, Springer LNCS 3016, 2004; 51-72, Available at: http://dx.doi.org/10.1007/978-3-540-25935-0_4.
[26]
Savidis A, Bourdenas T, Georgalis J. An adaptable circular meta-IDE for a dynamic programming language. In Proceedings of the 4th International Workshop on Rapid Integration of Software Engineering Techniques RISE 2007, Luxemburg, 2007; 99-114. Available at: "http://www.ics.forth.gr/hci/files/plang/sparrow.pdf". [last accessed 18 October 2013].
[27]
Lilis Y, Savidis A. Supporting compile-time debugging and precise error reporting in meta-programs. In the 50th International Conference on Objects, Models, Components, Patterns, Prague, Czech Republic, Springer LNCS 7304, 2012; 155-170, Available at: http://dx.doi.org/10.1007/978-3-642-30561-0_12.
[28]
Goodenough JB. Exception handling: issues and a proposed notation. Communications of the ACM 1975; Volume 18 Issue 12: pp.683-696. Available at: "http://doi.acm.org/10.1145/361227.361230".
[29]
Lilis Y, Savidis A. Implementing reusable exception handling patterns with compile-time metaprogramming. In Proceedings of the 4th International Workshop on Software Engineering for Resilient Systems, Pisa, Italy, Springer LNCS 7527, 2012; 1-15. Available at: http://dx.doi.org/10.1007/978-3-642-33176-3_1.
[30]
Gamma E, Helm R, Johnson R, Vlissides J. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Professional, 1994. November 1994; ISBN 978-0201633610.
[31]
Veldhuizen TL. C++ templates are Turing Complete. Technical Report, Indiana University Computer Science, 2003. Available at: "http://ubietylab.net/ubigraph/content/Papers/pdf/CppTuring.pdf". [last accessed 18 October 2013]
[32]
Porkolab Z, Mihalicza J, Sipos A. Debugging C++ template metaprograms. In Proceedings of the 5th International Conference on Generative Programming and Component Engineering GPCE '06, ACM: New York, NY, USA, 2006; 255-264, 2006, Available at: http://dx.doi.org/10.1145/1173706.1173746.
[33]
Nicklisch-Franken J, Mackenzie H, Frank A, Gruber C. Leksah: an integrated development environment for Haskell, 2010. Available at: "http://leksah.org/leksah_manual.pdf". [last accessed 18 October 2013].
[34]
Subramaniam V. Programming Groovy 2: Dynamic Productivity for the Java Developer. Pragmatic Bookshelf, 2013; ISBN 978-1-93778-530-7.
[35]
JetBrains. IntelliJIDEA - Groovy and Grails. Available at: "http://www.jetbrains.com/idea/features/groovy_grails.html"<span cssStyle="text-decoration:underline">.</span> [last accessed 18 October 2013].
[36]
Dybvig RK. Writing hygienic macros in Scheme with syntax-case. Technical Report, Indiana University Computer Science Department, 1992. Available at: "http://www.cs.indiana.edu/~dyb/pubs/tr356.pdf". [last accessed 18 October 2013].
[37]
Moore JS. The InterLisp virtual machine specification. Technical Report CSL 76-5, Xerox Palo Alto Research Center, 1976. Available at: "http://www.cs.utexas.edu/~moore/publications/interlisp-vm.pdf". [last accessed 18 October 2013].
[38]
Westbrook E, Ricken M, Inoue J, Yao Y, Abdelatif T, Taha W. Mint: Java multi-stage programming using weak separability. In Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation PLDI '10, ACM: New York, NY, USA, 2010; 400-411. Available at: "http://doi.acm.org/10.1145/1806596.1806642".

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Software
Software  Volume 45, Issue 6
June 2015
141 pages
ISSN:0038-0644
EISSN:1097-024X
Issue’s Table of Contents

Publisher

John Wiley & Sons, Inc.

United States

Publication History

Published: 01 June 2015

Author Tags

  1. compile-time metaprograms
  2. metaprogramming model
  3. multi-stage languages
  4. staged compilation

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media