DSL and Metaprogramming Resources
Tuesday, December 21, 2004
I've been discussing Domain-Specific Languages and metaprogramming recently (see here and here) and why Lisp has special strengths in this area. A couple of people have asked me for some links to additional material on why DSL's are a "good thing" and how to create them. One good resource is "Domain-Specific Languages: An Annotated Bibliography". Although it is not specific to Lisp, it is still a good resource for information and papers on DSL's. The abstract on the page says:
"We survey the literature available on the topic of domain-specific languages as used for the construction and maintenance of software systems. We list a selection of 75 key publications in the area, and provide a summary for each of the papers. Moreover, we discuss terminology, risks and benefits, example domain-specific languages, design methodologies, and implementation techniques."There is also a paper on "Notable Design Patterns for Domain-Specific Languages" that outlines different approaches to DSL's using a pattern approach.
For people looking for good Lisp examples in a book format, the classics are still the best:
- Structure and Interpretation of Computer Programs (SICP) by Abelson/Sussman
- Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp (PAIP) by Peter Norvig
Lastly (and to make sure I end on a Lisp note), I recently came across a good quote in the conclusion of the paper by Abelson and Sussman, "Lisp: A Language for Stratified Design", that nicely summarizes why Lisp is so well suited for metaprogramming and DSL's:
"People who first learn about Lisp often want to know for what particular programming problems Lisp is 'the right language.' The truth is that Lisp is not the right language for any particular problem. Rather, Lisp encourages one to attack a new problem by implementing new languages tailored to that problem. Such a language might embody an alternative computational paradigm, as in the rule language. Or it might be a collection of procedures that implement new primitives, means of combination, and means of abstraction embedded within Lisp, as in the Henderson drawing language. A linguistic approach to design is an essential aspect not only of programming but of engineering design in general. Perhaps that is why Lisp, although the second-oldest computer language in widespread use today (only FORTRAN is older), still seems new and adaptable, and continues to accommodate current ideas about programming methodolgoy."Or (to put it more succinctly), there's also the quote by Guy Steel that I referenced in my post "Common Lisp is the Borg of programming languages":
"If you give someone Fortran, he has Fortran. If you give someone Lisp, he has any language he pleases."