Can Anyone Recommend A Good DSL Book?

Discussion in 'Ruby' started by Sean Mountcastle, Mar 1, 2006.

  1. I apologize if this has been asked on this list before (I did a quick
    search using Namazu and didn't find any specific books; perhaps that's
    because they don't exist):

    Are there any good books on domain specific languages (preferably in
    Ruby)? I've read Fowler's article on DSLs, I attended Glenn
    Vanderburg's "Metaprogramming Ruby" talk at OSCON, I also listened to
    Rich Kilmer speak at a NoVARUG meeting about a DSL he wrote for the
    USAF/BBN and I've listened to the recording of Domain Specific
    Languages by Jim Weirich from RubyConf 2005 -- but I still don't "get"
    it. It seems like black magic to me, so I'm hoping there's a book out
    there devoted to implementing DSLs using Ruby that can help me better
    understand this useful technique.

    Does anyone know of such a book?

    Many thanks in advance,
    Sean
    Sean Mountcastle, Mar 1, 2006
    #1
    1. Advertising

  2. Sean Mountcastle

    James Britt Guest

    Sean Mountcastle wrote:
    > I apologize if this has been asked on this list before (I did a quick
    > search using Namazu and didn't find any specific books; perhaps that's
    > because they don't exist):


    It's a good question.

    >
    > Are there any good books on domain specific languages (preferably in
    > Ruby)? I've read Fowler's article on DSLs, I attended Glenn
    > Vanderburg's "Metaprogramming Ruby" talk at OSCON, I also listened to
    > Rich Kilmer speak at a NoVARUG meeting about a DSL he wrote for the
    > USAF/BBN and I've listened to the recording of Domain Specific
    > Languages by Jim Weirich from RubyConf 2005 -- but I still don't "get"
    > it. It seems like black magic to me, so I'm hoping there's a book out
    > there devoted to implementing DSLs using Ruby that can help me better
    > understand this useful technique.
    >
    > Does anyone know of such a book?


    There are some DSL articles in the pipeline for Ruby Code & Style[0], so
    hopefuly they'll help you, but a more detailed book on DSLs would be
    interesting.


    [0] http://www.artima.com/rubycs


    --
    James Britt

    "In physics the truth is rarely perfectly clear, and that is certainly
    universally the case in human affairs. Hence, what is not surrounded by
    uncertainty cannot be the truth."
    - R. Feynman
    James Britt, Mar 1, 2006
    #2
    1. Advertising

  3. Sean Mountcastle wrote:
    > Are there any good books on domain specific languages (preferably in
    > Ruby)?
    > Does anyone know of such a book?


    I would *love* to see a book about ruby DSLs. After seeing a little
    about how other people design them at RubyConf, it's become clear to
    me that there are quite a number of different good ways to implement
    DSLs in ruby. Why this should be, I don't know. It doesn't seem to
    have been a deliberate feature of the language. I know of no such
    book, but I hope someone out there will consider writing one, if they
    aren't already.

    If it helps, you can think of a DSL as just a particularly clear and
    naturalistic API.
    Caleb Clausen, Mar 1, 2006
    #3
  4. Sean Mountcastle

    Guest

    On Mar 1, 2006, at 11:01 AM, James Britt wrote:
    > Sean Mountcastle wrote:
    >> I apologize if this has been asked on this list before (I did a quick
    >> search using Namazu and didn't find any specific books; perhaps
    >> that's
    >> because they don't exist):

    >
    > It's a good question.


    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


    Gary Wright
    , Mar 1, 2006
    #4
  5. Sean Mountcastle

    Tom Copeland Guest

    >
    > 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
    Tom Copeland, Mar 1, 2006
    #5
  6. Sean Mountcastle

    Phil Tomson Guest

    In article <>,
    Sean Mountcastle <> wrote:
    >I apologize if this has been asked on this list before (I did a quick
    >search using Namazu and didn't find any specific books; perhaps that's
    >because they don't exist):
    >
    >Are there any good books on domain specific languages (preferably in
    >Ruby)? I've read Fowler's article on DSLs, I attended Glenn
    >Vanderburg's "Metaprogramming Ruby" talk at OSCON, I also listened to
    >Rich Kilmer speak at a NoVARUG meeting about a DSL he wrote for the
    >USAF/BBN and I've listened to the recording of Domain Specific
    >Languages by Jim Weirich from RubyConf 2005 -- but I still don't "get"
    >it. It seems like black magic to me, so I'm hoping there's a book out
    >there devoted to implementing DSLs using Ruby that can help me better
    >understand this useful technique.
    >
    >Does anyone know of such a book?
    >
    >Many thanks in advance,
    >Sean
    >


    Not a book, but I'm starting a new blog with a series of articles on how I'm
    re-visioning RHDL - A Ruby-based DSL for describing digital circuits. HDLs
    (Hardware Description Languages) are likely not familiar to folks here so let
    me give you a bit of background: HDLs such as VHDL and Verilog are used heavily
    now for designing chips. The semantics of an HDL are mostly quite different
    from the semantics of a regular programming language; think of HDLs as dataflow
    languages which also describe circuit structure and/or behavior. Even if
    you're not interested in HDLs, this dataflow aspect might be interesting
    for some as a method for dealing with concurrency.

    I'll try to put post up at least every other day or so. Feel free to post
    comments and questions. I want this to eventually lead to a series of
    articles and I figure this is a way of writing them and getting immediate
    feedback. Here's the link:

    http://blog.thoughtfiz.net/

    Phil
    Phil Tomson, Mar 1, 2006
    #6
  7. 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 <> 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
    >
    >
    >
    Sean Mountcastle, Mar 1, 2006
    #7
  8. On Mar 1, 2006, at 10:06 AM, Sean Mountcastle wrote:

    > I apologize if this has been asked on this list before (I did a quick
    > search using Namazu and didn't find any specific books; perhaps that's
    > because they don't exist):
    >
    > Are there any good books on domain specific languages (preferably in
    > Ruby)? I've read Fowler's article on DSLs, I attended Glenn
    > Vanderburg's "Metaprogramming Ruby" talk at OSCON, I also listened to
    > Rich Kilmer speak at a NoVARUG meeting about a DSL he wrote for the
    > USAF/BBN and I've listened to the recording of Domain Specific
    > Languages by Jim Weirich from RubyConf 2005 -- but I still don't "get"
    > it. It seems like black magic to me, so I'm hoping there's a book out
    > there devoted to implementing DSLs using Ruby that can help me better
    > understand this useful technique.
    >
    > Does anyone know of such a book?
    >
    > Many thanks in advance,
    > Sean
    >


    I don't know of anything specific. Some of the lisp books, for
    example Peter Seibel's book 'Practical Common Lisp' (<http://
    www.gigamonkeys.com/book/> the pdf is freely available) touches on
    the subject but in CL the idea is kind of fundamental so it is
    sometimes not specifically named as DSL and it is all through the
    book (in CL you basically program by building DSLs). Same with Paul
    Graham's book 'On Lisp' <http://www.paulgraham.com/onlisp.html> also
    with a freely available pdf version. Both books are excellent,
    Graham's is in my short-list of Important Software Books.

    In the Ruby world, the best I've read is David Black's 'Ruby for
    Rails'. It isn't available yet (it is being released chapter by
    chapter at Manning). It also isn't explicitly about DSLs but it is
    one of the best that I've seen on the subject and discusses Rails as
    a DSL.

    Cheers,
    Bob

    ----
    Bob Hutchison -- blogs at <http://www.recursive.ca/
    hutch/>
    Recursive Design Inc. -- <http://www.recursive.ca/>
    Raconteur -- <http://www.raconteur.info/>
    xampl for Ruby -- <http://rubyforge.org/projects/xampl/>
    Bob Hutchison, Mar 4, 2006
    #8
  9. Sean Mountcastle

    chiaro scuro Guest

    On 3/1/06, Sean Mountcastle <> wrote:
    > Are there any good books on domain specific languages (preferably in
    > Ruby)? I've read Fowler's article on DSLs, I attended Glenn
    > Vanderburg's "Metaprogramming Ruby" talk at OSCON, I also listened to
    > Rich Kilmer speak at a NoVARUG meeting about a DSL he wrote for the


    While it's not a DSL book, Domain Driven Design by Evans is going to
    be a *very useful* read if you are going to create a DSL.

    -- Chiaroscuro --
    Liquid Development Blog: http://liquiddevelopment.blogspot.com
    chiaro scuro, Mar 4, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zer0 Voltage
    Replies:
    5
    Views:
    6,785
    kinshuk4
    Jun 27, 2011
  2. Replies:
    4
    Views:
    370
    Mike Scirocco
    Nov 2, 2003
  3. Steven Green
    Replies:
    5
    Views:
    531
    Rolf Magnus
    Dec 24, 2003
  4. Gil
    Replies:
    2
    Views:
    347
  5. Angus
    Replies:
    1
    Views:
    92
    Ian Collins
    Apr 5, 2007
Loading...

Share This Page