6

There are a lot of books on domain specific languages (DSLs). Such books talk about compilers, interpreters, parsing, lexing, semantic analysis, and other various bits someone needs to implement a DSL.

I already know how to implement a DSL; I've implemented several. However, several such DSLs have been monsters to work with. One starts out with whatever features one wants to support in the DSL, only to find that more features get added later, resulting in a mess of wacky and inconsistent conventions.

I'm going to be designing a new DSL here and I want to start off on the correct foot, with an eye this time for future expansion of the language. The few books I've been able to find on language design seemed to be focused on general purpose (and C derived) language design, which is not a path that makes sense for my domain.

What kinds of references or books are available on this topic?

Doc Brown
  • 199,015
  • 33
  • 367
  • 565
Billy ONeal
  • 8,073
  • 6
  • 43
  • 57

2 Answers2

5

I have not read it, but I'd recommend the book by Martin Fowler on the subject "Domain Specific Languages". Many of his other books have proven to be very insightful and helpful in my thinking about software development. And I expect the DSL book to be as much so (it is on my to read list).

http://martinfowler.com/books.html

Marjan Venema
  • 8,151
  • 3
  • 32
  • 35
  • Unfortunately this talks a lot about how to implement DSLs in terms of software design, but little about how to design one people will like to use. :( – Billy ONeal Oct 21 '11 at 16:47
2

Practical Common Lisp goes through details of designing several DSLs. Something on denotational semantics and languages in general might add a bit of necessary understanding.

There are no widely accepted "best practices" and methodologies yet - it is still pretty much an art, so the best way of learning is by example of existing successful implementations, and of course an underlying theory of programming languages is essential.

SK-logic
  • 8,497
  • 4
  • 25
  • 37