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.
- A. Alexandrescu. The D Programming Language. Addison-Wesley Professional, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- J. Dureg˚ard and P. Jansson. Embedded Parser Generators. Proc. 4th ACM SIGPLAN Symposium on Haskell (Haskell 2011), pp. 107–117, 2011. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Fowler. Domain Specific Languages. Addison-Wesley Professional, 2011. Google Scholar
Digital Library
- A. Gill. Type-safe Observable Sharing in Haskell. Proc. 2nd ACM SIGPLAN Symposium on Haskell (Haskell 2009), pp. 117–128, 2009. Google Scholar
Digital Library
- A. Gill. Domain-specific Languages and Code Synthesis Using Haskell. ACM Queue, Vol. 12, No. 4, pp. 30:30–30:43, 2014. Google Scholar
Digital Library
- P. Hudak. Building Domain-specific Embedded Languages. ACM Comput. Surv., Vol. 28, No. 4es, Article. 196, 1996. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- E. Niebler. Proto: A Compiler Construction Toolkit for DSELs, Proc. 2007 Symposium on Library-Centric Software Design (LCSD 2007), pp. 42–51, 2007. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. G. Siek, L.Q. Lee, and A. Lumsdaine. The Boost Graph Library: User Guide and Reference Manual. Addison-Wesley Professional, 2001.Google Scholar
- 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 Scholar
Digital Library
- L. Tratt. Domain Specific Language Implementation via Compiletime Meta-programming. ACM Trans. Program. Lang. Syst., Vol. 30, No. 6, pp. 1–40, 2008. Google Scholar
Digital Library
Index Terms
LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming
Recommendations
A Survey of Metaprogramming Languages
Metaprogramming is the process of writing computer programs that treat programs as data, enabling them to analyze or transform existing programs or generate new ones. While the concept of metaprogramming has existed for several decades, activities ...
LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming
GPCE 2014: Proceedings of the 2014 International Conference on Generative Programming: Concepts and ExperiencesThis 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 ...
Explicitly heterogeneous metaprogramming with MetaHaskell
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingLanguages with support for metaprogramming, like MetaOCaml, offer a principled approach to code generation by guaranteeing that well-typed metaprograms produce well-typed programs. However, many problem domains where metaprogramming can fruitfully be ...






Comments