Can Anyone Recommend A Good DSL Book?

Check out Code Generation in Action. It's a good book on code generation that uses Ruby/erb/REXML/etc. Interestingly, it was the book that got me off of my arse and looking at Ruby........

···

From: Sean Mountcastle <smountcastle@gmail.com>
Date: Wed Mar 01 14:30:46 CST 2006
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Subject: Re: Can Anyone Recommend A Good DSL Book?

Gary and Tom,

Thanks for the pointers, I've read the AW AWK Programming Language and
O'Reilly lex & yacc books. From the presentations I've seen on Ruby
DSLs, it doesn't seem like folks are writing parsers -- it seems more
like Lisp macros where the program is being written as its being
interpreted.

In the same way that Ruby's attr_accessor creates getter/setter
methods for the specified symbols (instance variables), DSL 'gurus'
have created similar constructs which implement the 'mini language'
without the drugery of writing a parser/compiler.

It looks like there are no "How to write DSLs in Ruby" books currently
available or planned.

Regards,
Sean

On 3/1/06, Tom Copeland <tom@infoether.com> wrote:

>
> You might want to read chapter 6 of The AWK Programming
> Language (Aho, Kernighan, Weinberger). The title of that
> chapter is 'little
> languages'.
> The chapter includes the following examples (in AWK of course):
>
> assembler and interpreter
> drawing graphs
> a sort generator
> a reverse-polish calculator
> an infix calculator
> recursive-descent parsing

Along the same lines, the O'Reilly Lex and Yacc book (by John Levine and
several others) has some little DSL examples - a menu generation system
and whatnot.

Yours,

Tom