skip to main content
10.1145/1621607.1621624acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Generating safe template languages

Published: 04 October 2009 Publication History

Abstract

Template languages are widely used within generative programming, because they provide intuitive means to generate software artefacts expressed in a specific object language. However, most template languages perform template instantiation on the level of string literals, which allows neither syntax checks nor semantics analysis. To make sure that generated artefacts always conform to the object language, we propose to perform static analysis at template design time. In addition, the increasing popularity of domainspecific languages (DSLs) demands an approach that allows to reuse both the concepts of template languages and the corresponding tools.
In this paper we address the issues mentioned above by presenting how existing languages can be automatically extended with generic template concepts (e.g., placeholders, loops, conditions) to obtain safe template languages. These languages provide means for syntax checking and static semantic analysis w.r.t. the object language at template design time. We discuss the prerequisites for this extension, analyse the types of correctness properties that can be assured at template design time, and exemplify the key benefits of this approach on a textual DSL and Java.

References

[1]
Jeroen Arnoldus, Jeanot Bijpost, and Mark van den Brand. Repleo: a Syntax-Safe Template Engine. In Proceedings of the 6th International Conference on Generative Programming and Component Engineering (GPCE 2007), pages 25--32, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-855-8.
[2]
Gilad Bracha and Gary Lindstrom. Modularity Meets Inheritance. In Proceedings of the 1992 International Conference on Computer Languages, pages 282--290. IEEE Computer Society, 1992.
[3]
Martin Bravenboer and Eelco Visser. Concrete Syntax for Objects: Domain-Specific Language Embedding and Assimilation without Restrictions. In John M. Vlissides and Douglas C. Schmidt, editors, Proceedings of the 19th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2004), pages 365--383. ACM, October 2004. ISBN 1-58113-831-8.
[4]
Martin Bravenboer, Rene de Groot, and Eelco Visser. MetaBorg in Action: Examples of Domain-specific Language Embedding and Assimilation using Stratego/XT. In R. Lammel and J. Saraiva, editors, Proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE 2005), volume 4143 of Lecture Notes in Computer Science, pages 297--311, Berlin, Heidelberg, 2006. Springer.
[5]
Martin Bravenboer, Karl Trygve Kalleberg, Rob Vermaas, and Eelco Visser. Stratego/XT 0.17. A Language and Toolset for Program Transformation. Science of Computer Programming, 72(1-2):52--70, June 2008. ISSN 0167-6423. Special issue on experimental software and toolkits.
[6]
Sergey Dmitriev. Language Oriented Programming: The Next Programming Paradigm. White Paper, JetBrains, 2004. URL http://www.onboard.jetbrains.com/is1/articles/04/10/lop.
[7]
Torbjorn Ekman and Gorel Hedin. Modular name analysis for Java using JastAdd. In R. Lammel and J. Saraiva, editors, Proceedings of the Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE 2005), volume 4143 of Lecture Notes in Computer Science, Berlin, Heidelberg, 2006. Springer.
[8]
Douglas Gregor, Jaakko Jarvi, Jeremy Siek, Bjarne Stroustrup, Gabriel Dos Reis, and Andrew Lumsdaine. Concepts: linguistic support for generic programming in C++. In Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications (OOPSLA 2006), pages 291--310, New York, NY, USA, 2006. ACM. ISBN 1-59593-348-4.
[9]
Falk Hartmann. An Architecture for an XML-Template Engine Enabling Safe Authoring. In Proceedings of the 17th International Workshop on Database and Expert Systems Applications (DEXA 2006), pages 502--507. IEEE Computer Society, 2006.
[10]
Falk Hartmann. Ensuring the Instantiation Results of XML Templates. In Proceedings of the IADIS International Conference WWW/Internet 2007, 2007.
[11]
Jan Heering, P.R.H. Hendriks, Paul Klint, and Jan Rekers. The Syntax Definition Formalism SDF"Reference Manual". SIGPLAN Not., 24 (11):43--75, 1989. ISSN 0362-1340.
[12]
Florian Heidenreich, Jakob Henriksson, Jendrik Johannes, and Steffen Zschaler. On Language-Independent Model Modularisation. Transactions on Aspect-Oriented Development, Special Issue on Aspects and MDE, 2008. To Appear.
[13]
Florian Heidenreich, Jendrik Johannes, Sven Karol, Mirko Seifert, and ChristianWende. Derivation and Refinement of Textual Syntax for Models, Accepted for publication. In Proceedings of the 5th European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2009), 2009
[14]
Shan Shan Huang and Yannis Smaragdakis. Expressive and safe static reflection with morphj. SIGPLAN Not., 43(6):79--89, 2008. ISSN 0362-1340.
[15]
Shan Shan Huang, David Zook, and Yannis Smaragdakis. Statically Safe Program Generation with SafeGen. In Robert Gl¨uck and Michael R. Lowry, editors, Proceedings of the 4th International Conference on Generative Programming and Component Engineering (GPCE 2005), volume 3676 of Lecture Notes in Computer Science, pages 309--326. Springer, 2005. ISBN 3-540-29138-5.
[16]
Stan Jarzabek, Paul Bassett, Hongyu Zhang, and Weishan Zhang. XVCL: XML-based Variant Configuration Language. Proceedings of the 25th International Conference on Software Engineering (ICSE 2003), pages 810--811, May 2003.
[17]
JetBrains. JetBrains Meta Programming System (MPS), 2009. URL http://www.jetbrains.com/mps.
[18]
Anneke Kleppe. Software Language Engineering. Pearson Education, 2009. ISBN 0321553454.
[19]
oAW Project Team. openArchitectureWare, 2009. URL http://www.openArchitectureWare.org.
[20]
Jon Oldevik. MOFScript Eclipse Plug-In: Metamodel-Based Code Generation. In Eclipse Technology Workshop (EtX) at ECOOP 2006, 2006.
[21]
OMG. MOF 2.0 core specification. OMG Document, January 2006. URL http://www.omg.org/spec/MOF/2.0. URL http://www.omg.org/spec/MOF/2.0.
[22]
Terence John Parr. Enforcing Strict Model-View Separation in Template Engines. In Stuart I. Feldman, Mike Uretsky, Marc Najork, and Craig E. Wills, editors, Proceedings of the 13th International Conference on World Wide Web (WWW 2004), pages 224--233. ACM, May 2004. ISBN 1-58113-844-X.
[23]
Louis M. Rose, Richard F. Paige, Dimitrios S. Kolovos, and Fiona A. Polack. The Epsilon Generation Language. In Proceedings of the 4th European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2008), pages 1--16, Berlin, Heidelberg, 2008. Springer. ISBN 978-3-540-69095-5.
[24]
Daniel A. Sadilek and Guido Wachsmuth. Using Grammarware Languages To Define Operational Semantics of Modelled Languages. In Proceedings of the 47th International Conference Objects, Models, Components, Patterns (TOOLS 2009), volume 33 of Lecture Notes in Business Information Processing, pages 348--356. Springer, 2009. ISBN 978-3-642-02570-9.
[25]
Antero Taivalsaari. On the Notion of Inheritance. ACM Computing Surveys, 28(3):438--479, 1996.
[26]
Mark van den Brand, Jan Heering, Hayco de Jong, Merijn de Jonge, Tobias Kuipers, Paul Klint, Leon Moonen, Pieter Olivier, Jeroen Scheerder, Jurgen Vinju, Eelco Visser, and Joost Visser. The ASF+SDF Meta-Environment: a Component-Based Language Development Environment. In Proceedings of the 10th International Conference on Compiler Construction (CC 2001), volume 2027 of Lecture Notes in Computer Science, pages 365--370. Springer, 2001. ISBN 3-540-41861-X.
[27]
Eelco Visser. Scannerless Generalized-LR Parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, July 1997a.
[28]
Eelco Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, September 1997b.

Cited By

View all
  • (2024)A Core Calculus for Documents: Or, Lambda: The Ultimate DocumentProceedings of the ACM on Programming Languages10.1145/36328658:POPL(667-694)Online publication date: 5-Jan-2024
  • (2018)DropsBoxSoftware and Systems Modeling (SoSyM)10.1007/s10270-012-0284-613:1(133-169)Online publication date: 21-Dec-2018
  • (2013)Model-Based Language Engineering with EMFTextGenerative and Transformational Techniques in Software Engineering IV10.1007/978-3-642-35992-7_9(322-345)Online publication date: 2013
  • Show More Cited By

Index Terms

  1. Generating safe template languages

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    GPCE '09: Proceedings of the eighth international conference on Generative programming and component engineering
    October 2009
    194 pages
    ISBN:9781605584942
    DOI:10.1145/1621607
    • General Chair:
    • Jeremy Siek,
    • Program Chair:
    • Bernd Fischer
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 45, Issue 2
      GPCE '09
      February 2010
      182 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1837852
      Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 04 October 2009

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. generative programming
    2. language extension
    3. safe authoring
    4. template language

    Qualifiers

    • Research-article

    Conference

    GPCE'09
    Sponsor:
    GPCE'09: Generative Programming and Component Engineering
    October 4 - 5, 2009
    Colorado, Denver, USA

    Acceptance Rates

    GPCE '09 Paper Acceptance Rate 18 of 62 submissions, 29%;
    Overall Acceptance Rate 56 of 180 submissions, 31%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)14
    • Downloads (Last 6 weeks)4
    Reflects downloads up to 16 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)A Core Calculus for Documents: Or, Lambda: The Ultimate DocumentProceedings of the ACM on Programming Languages10.1145/36328658:POPL(667-694)Online publication date: 5-Jan-2024
    • (2018)DropsBoxSoftware and Systems Modeling (SoSyM)10.1007/s10270-012-0284-613:1(133-169)Online publication date: 21-Dec-2018
    • (2013)Model-Based Language Engineering with EMFTextGenerative and Transformational Techniques in Software Engineering IV10.1007/978-3-642-35992-7_9(322-345)Online publication date: 2013
    • (2012)Towards well-formed fragment composition with reference attribute grammarsProceedings of the 15th ACM SIGSOFT symposium on Component Based Software Engineering10.1145/2304736.2304755(109-114)Online publication date: 25-Jun-2012
    • (2014)Towards the Systematic Construction of Domain-Specific Transformation LanguagesProceedings of the 10th European Conference on Modelling Foundations and Applications - Volume 856910.1007/978-3-319-09195-2_13(196-212)Online publication date: 21-Jul-2014
    • (2012)JUGProceedings of the 17th ACM annual conference on Innovation and technology in computer science education10.1145/2325296.2325323(99-104)Online publication date: 3-Jul-2012

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media