Are there any design guides, tutorials, or patterns for designing a DSL?
Martin Fowler working on the Domain Languages process includes a good example in his introductory chapter (substantial portions of the book are available on the Internet). Its linked bliki page is also worth reading and includes some links to other resources.
Non-Fowler sources use Jeremy Miller's "Internal Domain Languages " patterns and techniques on the Internet. (Well, he's not really a non-Fowler source.)
a source to share
Your question is quite open-ended, but it is very interesting. Generally speaking, you need to think not only about the application domain, but also about the properties that you want to apply in your design.
There has been good academic work on this topic, I hope the following documents help you get started:
- "From a Family of Programs to a Domain Specific Language" is an attempt to shed light on the DSL design process. This is the first article article that came to my mind when I read your question, with the next two following questions related.
- for a high-level overview of DSLs, try DSLs: The Good, Bad, and Ugly, a paper in the Conference on Object-Oriented Programming Systems Languages ββand Applications;
- The "Generic Programming Approach to Developing DSL Compilers" is what you get from a high level specification to a DSL. This article presents a methodology for developing DSL compilers based on generative software tools, as well as a case study.
Hope this helps!
a source to share
My advice is to start with an internal DSL and an external DSL. Languages ββlike Lisp and Ruby make it easy to create internal DSLs. The advantage of using an internal DSL is you don't have to worry about parsing. Its quick and easy.
Another language that makes it easy to create a DSL is TCL. It's all a string! If you are using tclkit, you can wrap the entire DSL + TCL in one executable and send it everywhere.
a source to share
- DSL Book by Martin Fowler and Debashish Ghosh
- Notable Design Patterns for Diomidis Spinellis Domain Languages ββ( http://researchr.org/publication/Spinellis01%3A0/authors )
- Domain Language Design and Implementation Strategies by Dr. Eelko Visser ( http://www.slideshare.net/eelcovisser/mdsd05 )
Also, you may want to check out the content of the Drupal Driven Software Development course by Dr. Eelco Visser at http://department.st.ewi.tudelft.nl/course/in4308 for a discussion of various aspects of MDSD and DSL development.
Hope it helps!
Greetings,
Adil
a source to share