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

skip to main content
research-article
Open access

Domain specific language implementation via compile-time meta-programming

Published: 30 October 2008 Publication History

Abstract

Domain specific languages (DSLs) are mini-languages that are increasingly seen as being a valuable tool for software developers and non-developers alike. DSLs must currently be created in an ad-hoc fashion, often leading to high development costs and implementations of variable quality. In this article, I show how expressive DSLs can be hygienically embedded in the Converge programming language using its compile-time meta-programming facility, the concept of DSL blocks, and specialised error reporting techniques. By making use of pre-existing facilities, and following a simple methodology, DSL implementation costs can be significantly reduced whilst leading to higher quality DSL implementations.

References

[1]
Abadi, M. and Cardelli, L. 1996. A Theory of Objects. Springer-Verlag, New York.
[2]
Aycock, J. and Horspool, R. N. 2002. Practical Earley parsing. The Computer Journal 45, 6, 620--630.
[3]
Bachrach, J. and Playford, K. 1999. D-expressions: Lisp power, Dylan style. http://www.ai.mit.edu/people/jrb/Projects/dexprs.pdf Accessed Nov 22 2006.
[4]
Bachrach, J. and Playford, K. 2001. The Java syntactic extender (JSE). In Proceedings of the 14th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'99) (Denver, CO). ACM, New York, 31--42.
[5]
Brabrand, C. and Schwartzbach, M. 2000. Growing languages with metamorphic syntax macros. In Proceedings of the Workshop on Partial Evaluation and Semantics-Based Program Manipulation. SIGPLAN. ACM, New York.
[6]
Bravenboer, M. and Visser, E. 2004. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In Proceedings of the 19th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'04) (Vancouver, BC, Canada). ACM, New York.
[7]
Cointe, P. 1987. Metaclasses are first class: The ObjVLisp model. In Proceedings of the ACM Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA'87). ACM, New York, 156--162.
[8]
Cordy, J. R. 2004. TXL—A language for programming language tools and applications. In Proceedings of the ACM 4th International Workshop on Language Descriptions, Tools and Applications. ACM, New York.
[9]
Czarnecki, K., O'Donnell, J., Striegnitz, J., and Taha, W. 2004. DSL implementation in MetaOCaml, Template Haskell, and C++. 3016, 50--71.
[10]
Dybvig, R. K., Hieb, R., and Bruggeman, C. 1992. Syntactic abstraction in scheme. In Lisp and Symb. Comput. 5. 295--326.
[11]
Earley, J. 1970. An efficient context-free parsing algorithm. Commun. ACM 13, 2 (Feb.).
[12]
Fleutot, F. and Tratt, L. 2007. Contrasting compile-time meta-programming in Metalua and Converge. In Proceedings of the Workshop on Dynamic Languages and Applications.
[13]
Goldberg, A. and Robson, D. 1989. Smalltalk-80: The Language. Addison-Wesley, Reading, MA.
[14]
Grimm, R. 2005. Systems need languages need systems! 2nd ECOOP Workshop on Programming Languages and Operating Systems.
[15]
Griswold, R. E. and Griswold, M. T. 1996. The Icon Programming Language, Third ed. Peer-to-Peer Communications.
[16]
Hudak, P. 1998. Modular domain specific languages and tools. In Proceedings of the 5th International Conference on Software Reuse. 134--142.
[17]
Kohlbecker, E., Friedman, D. P., Felleisen, M., and Duba, B. 1986. Hygienic macro expansion. In Proceedings of the Symposium on Lisp and Functional Programming. ACM, New York, 151--161.
[18]
Mernik, M., Heering, J., and Sloane, A. M. 2003. When and how to develop domain-specific languages. Tech. rep., Centrum voor Wiskundeen Informatica. Dec.
[19]
Schröer, F. W. 2005. The ACCENT Grammar Language. http://accent.compilertools.net/language.html Accessed Jan 25 2005.
[20]
Seefried, S., Chakravarty, M., and Keller, G. 2004. Optimising embedded DSLs using template Haskell. In Proceedings of the 3rd International Conference on Generative Programming and Component Engineering (Vancouver, BC Canada). Springer-Verlag, New York, 186--205.
[21]
Sheard, T. 1998. Using MetaML: A staged programming language. Adv. Funct. Prog., 207--239.
[22]
Sheard, T. 2003. Accomplishments and research challenges in meta-programming. Proceedings of the Workshop on Semantics, Applications and Implementation of Program Generation (SAIG '01) 2196, 2--44.
[23]
Sheard, T., el Abidine Benaissa, Z., and Pasalic, E. 1999. DSL implementation using staging and monads. In Proceedings of the 2nd Conference on Domain Specific Languages. SIGPLAN, vol. 35. ACM, New York, 81--94.
[24]
Sheard, T. and Jones, S. P. 2002. Template meta-programming for Haskell. In Proceedings of the Haskell Workshop 2002. ACM, New York.
[25]
Skalski, K., Moskal, M., and Olszta, P. 2004. Meta-programming in Nemerle. http://nemerle.org/metaprogramming.pdf. Accessed Nov 5 2007.
[26]
Steele, Jr, G. L. 1999. Growing a language. Higher-Order and Symbolic Computation 12, 3 (Oct.), 221--236.
[27]
Tratt, L. 2005a. Compile-time meta-programming in a dynamically typed OO language. In Proceedings of the Dynamic Languages Symposium. 49--64.
[28]
Tratt, L. 2005b. The Converge programming language. Tech. Rep. TR-05-01, Department of Computer Science, King's College London.
[29]
Tratt, L. 2005c. The MT model transformation language. Tech. Rep. TR-05-02, Department of Computer Science, King's College London. May.
[30]
Tratt, L. 2007. Converge Reference Manual. http://www.convergepl.org/documentation/Accessed June 3 2008.
[31]
van den Brand, M. G. J., Heering, J., Klint, P., and Olivier, P. A. 2002. Compiling language definitions: the asf+sdf compiler. ACM Trans. Program. Lang. Syst. 24, 4, 334--368.
[32]
van Deursen, A., Klint, P., and Visser, J. 2000. Domain-specific languages: An annotated bibliography. SIGPLAN Notices, 35, 26--36.
[33]
van Rossum, G. 2003. Python 2.3 reference manual. http://www.python.org/doc/2.3/ref/ref.html Accessed June 3 2008.
[34]
Walker, K. 1994. The run-time implementation language for Icon. Tech. Rep. IPD261, University of Arizona.
[35]
Weise, D. and Crew, R. 1993. Programmable syntax macros. In Proceedings of the SIGPLAN. ACM, New York, 156--165.
[36]
Wilson, G. V. 2005. Extensible programming for the 21st century. Queue 2, 9 (Jan.), 48--57.

Cited By

View all

Index Terms

  1. Domain specific language implementation via compile-time meta-programming

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Programming Languages and Systems
    ACM Transactions on Programming Languages and Systems  Volume 30, Issue 6
    October 2008
    245 pages
    ISSN:0164-0925
    EISSN:1558-4593
    DOI:10.1145/1391956
    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]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 30 October 2008
    Accepted: 01 January 2008
    Revised: 01 January 2007
    Received: 01 February 2006
    Published in TOPLAS Volume 30, Issue 6

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Syntax extension
    2. compile-time meta-programming
    3. domain specific languages

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

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

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Software modernization powered by dynamic language product linesJournal of Systems and Software10.1016/j.jss.2024.112188218(112188)Online publication date: Dec-2024
    • (2024) i C o L a +Journal of Systems and Software10.1016/j.jss.2024.111979211:COnline publication date: 2-Jul-2024
    • (2023)On the granularity of linguistic reuseJournal of Systems and Software10.1016/j.jss.2023.111704202(111704)Online publication date: Aug-2023
    • (2023)The language mutation problem: Leveraging language product lines for mutation testing of interpretersJournal of Systems and Software10.1016/j.jss.2022.111533195(111533)Online publication date: Jan-2023
    • (2023)Reducing the Power Consumption of IoT with Task-Oriented ProgrammingTrends in Functional Programming10.1007/978-3-031-21314-4_5(80-99)Online publication date: 1-Jan-2023
    • (2022)iCoLa: A Compositional Meta-language with Support for Incremental Language DevelopmentProceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3567512.3567529(202-215)Online publication date: 29-Nov-2022
    • (2022)Towards a recipe for language decomposition: quality assessment of language product linesEmpirical Software Engineering10.1007/s10664-021-10074-627:4Online publication date: 1-Jul-2022
    • (2022)Domain-Specific Type-Safe APIs for Hierarchical Scientific Data with Modern C++Responsible Data Science10.1007/978-981-19-4453-6_14(191-204)Online publication date: 15-Nov-2022
    • (2021)Handling Iterations in Distributed Dataflow SystemsACM Computing Surveys10.1145/347760254:9(1-38)Online publication date: 8-Oct-2021
    • (2020)A practical unification of multi-stage programming and macrosACM SIGPLAN Notices10.1145/3393934.327813953:9(14-27)Online publication date: 7-Apr-2020
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Full Access

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media