Domain specific language implementation via compile-time meta-programming

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.

[1]  Ralph E. Griswold,et al.  History of the Icon programming language , 1996 .

[2]  Krzysztof Czarnecki,et al.  DSL Implementation in MetaOCaml, Template Haskell, and C++ , 2003, Domain-Specific Program Generation.

[3]  Simon L. Peyton Jones,et al.  Template meta-programming for Haskell , 2002, Haskell '02.

[4]  Pierre Cointe Metaclasses are first class: The ObjVlisp Model , 1987, OOPSLA 1987.

[5]  Jonathan Bachrach,et al.  D-Expressions : Lisp Power , Dylan Style , 1999 .

[6]  Guy L. Steele,et al.  Growing a Language , 1999, High. Order Symb. Comput..

[7]  Matthias Felleisen,et al.  Hygienic macro expansion , 1986, LFP '86.

[8]  Pawel Olszta,et al.  Meta-programming in Nemerle , .

[9]  M Mernik,et al.  When and how to develop domain-specific languages , 2005, CSUR.

[10]  Claus Brabrand,et al.  Growing languages with metamorphic syntax macros , 2000, PEPM '02.

[11]  R. Nigel Horspool,et al.  Practical Earley Parsing , 2002, Comput. J..

[12]  Laurence Tratt,et al.  The Converge programming language. , 2005 .

[13]  Adele Goldberg,et al.  SmallTalk 80: The Language , 1989 .

[14]  Daniel Weise,et al.  Programmable syntax macros , 1993, PLDI '93.

[15]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[16]  Arie van Deursen,et al.  Domain-specific languages: an annotated bibliography , 2000, SIGP.

[17]  Pierre Cointe Metaclasses are First Class: the ObjVlisp Model , 1987, OOPSLA.

[18]  Paul Klint,et al.  Compiling language definitions: the ASF+SDF compiler , 2000, TOPL.

[19]  Laurence Tratt The MT model transformation language , 2006, SAC '06.

[20]  Ralph E. Griswold,et al.  The Icon programming language , 1983 .

[21]  Kenneth L. Walker The Run-Time Implementation Language for Icon V8.7 , 1992 .

[22]  Robert Hieb,et al.  Syntactic abstraction in scheme , 1992, LISP Symb. Comput..

[23]  Jonathan Bachrach,et al.  The Java syntactic extender (JSE) , 2001, OOPSLA '01.

[24]  Laurence Tratt,et al.  Compile-time meta-programming in a dynamically typed OO language , 2005, DLS '05.

[25]  Manuel M. T. Chakravarty,et al.  Optimising Embedded DSLs Using Template Haskell , 2004, GPCE.

[26]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[27]  James R. Cordy,et al.  TXL - A Language for Programming Language Tools and Applications , 2004, LDTA@ETAPS.

[28]  Tim Sheard Using MetaML: A Staged Programming Language , 1998, Advanced Functional Programming.

[29]  Paul Hudak,et al.  Modular domain specific languages and tools , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[30]  Gregory V. Wilson Extensible Programming for the 21st Century , 2004, ACM Queue.

[31]  Fred L. Drake,et al.  Python 3 Reference Manual , 2009 .

[32]  Tim Sheard,et al.  Accomplishments and Research Challenges in Meta-programming , 2001, SAIG.

[33]  Emir Pasalic,et al.  DSL implementation using staging and monads , 1999, DSL '99.

[34]  Anthony M. Sloane,et al.  Domain-specific languages , 2003, 36th Annual Hawaii International Conference on System Sciences, 2003. Proceedings of the.

[35]  Laurence Tratt,et al.  Contrasting compile-time meta-programming in metalua and converge. , 2007 .

[36]  Eelco Visser,et al.  Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions , 2004, OOPSLA '04.