skip to main content
article

LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming

Published:15 September 2014Publication History
Skip Abstract Section

Abstract

This paper presents a library called LibDSL that helps the implementer of an embedded domain specific language (EDSL) effectively develop it in D language. The LibDSL library accepts as input some kinds of ``specifications'' of the EDSL that the implementer is going to develop and a D program within which an EDSL source program written by the user is embedded. It produces the front-end code of an LALR parser for the EDSL program and back-end code of the execution engine. LibDSL is able to produce two kinds of execution engines, namely compiler-based and interpreter-based engines, either of which the user can properly choose depending on whether an EDSL program is known at compile time or not. We have implemented the LibDSL system by using template metaprogramming and other advanced facilities such as compile-time function execution of D language. EDSL programs developed by means of LibDSL have a nice integrativeness with the host language.

References

  1. A. Alexandrescu. The D Programming Language. Addison-Wesley Professional, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. E. Burmako. Scala Macros: Let Our Powers Combine!: On How Rich Syntax and Static Types Work with Metaprogramming. Proc. 4th Workshop on Scala (SCALA 2013), Article No. 3, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. Proc. 5th ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), pp. 268–279, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. K. Czarnecki, J. T. O’Donnell, J. Striegnitz, and W. Taha. DSL Implementation in MetaOCaml, Template Haskell, and C++. Domain-Specific Program Generation, pp. 51–72, 2003.Google ScholarGoogle Scholar
  5. J. Dureg˚ard and P. Jansson. Embedded Parser Generators. Proc. 4th ACM SIGPLAN Symposium on Haskell (Haskell 2011), pp. 107–117, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Ford. Parsing Expression Grammars: A Recognition-based Syntactic Foundation. Proc. 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2004), pp. 111-122, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Fowler. Domain Specific Languages. Addison-Wesley Professional, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Gill. Type-safe Observable Sharing in Haskell. Proc. 2nd ACM SIGPLAN Symposium on Haskell (Haskell 2009), pp. 117–128, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. Gill. Domain-specific Languages and Code Synthesis Using Haskell. ACM Queue, Vol. 12, No. 4, pp. 30:30–30:43, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. P. Hudak. Building Domain-specific Embedded Languages. ACM Comput. Surv., Vol. 28, No. 4es, Article. 196, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Hudak. Modular Domain Specific Language and Tools. Proc. 5th International Conference on Software Reuse (JCSR 1998). IEEE Computer Society, pp. 134–142, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Mernik, J. Heering, and A. M. Sloane. When and How to Develop Domain-specific Languages. ACM Comput. Surv., Vol. 37, No. 4, pp. 316–344, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Meijer, B. Beckman, and G. M. Bierman. LINQ: Reconciling Object, Relations and XML in the .NET framework. Proc. ACM SIGMOD International Conference on Management of Data (SIGMOD 2006 ), p.706, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Niebler. Proto: A Compiler Construction Toolkit for DSELs, Proc. 2007 Symposium on Library-Centric Software Design (LCSD 2007), pp. 42–51, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Z. Porkoláb and Á. Sinkovics. Domain-specific Language Integration with Compile-time Parser Generator Library. Proc. 9th International Conference on Generative Programming and Component Engineering (GPCE 2010), pp. 137–146, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. Rompf and M. Odersky. Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs. Proc. 9th International Conference on Generative Programming and Component Engineering (GPCE 2010), pp. 127–136, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. Sheard and S. Peyton Jones. Template Meta-programming for Haskell. Proc. 2002 ACM SIGPLAN Workshop on Haskell (Haskell 2002 ), pp. 1–16, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. G. Siek, L.Q. Lee, and A. Lumsdaine. The Boost Graph Library: User Guide and Reference Manual. Addison-Wesley Professional, 2001.Google ScholarGoogle Scholar
  19. L. Tratt. Compile-time Meta-programming in a Dynamically Typed OO language. Proc. 2005 Symposium on Dynamic Languages (DLS 2005 ), pp. 49–63, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. Tratt. Domain Specific Language Implementation via Compiletime Meta-programming. ACM Trans. Program. Lang. Syst., Vol. 30, No. 6, pp. 1–40, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 50, Issue 3
      GPCE '14
      March 2015
      141 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2775053
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        GPCE 2014: Proceedings of the 2014 International Conference on Generative Programming: Concepts and Experiences
        September 2014
        141 pages
        ISBN:9781450331616
        DOI:10.1145/2658761

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 15 September 2014

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!