Are there any design guides, tutorials, or patterns for designing a DSL?

I'm not looking for frameworks or tools, but advice on how to go from a rough idea to a nice DSL.

+2


a source to share


5 answers


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.)

+2


a source


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!

+1


a source


There is a DSL book by Martin Fowler (not published yet).

0


a source


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.

0


a source


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

0


a source







All Articles