Inspirations for a Ruby DSL

September 6th, 2009

Recently, during discussions with a client about reducing the amount of boilerplate coding that recurs from time to time in the project, the idea of developing a Domain Specific Language (DSL) arose. If you’re wondering what a DSL is, here is what Martin Fowler has to say. Or, you may prefer this cheeky piece from Dr Nic Williams.

I’ve been intrigued by DSLs for some time but not had the motivation to develop one until now.

In preparation, I’ve gathered a list of resources for writing a DSL in Ruby.


  • Russ Olsen’s two part article
  • Chapter 16 on DSLs in Russ Olsen’s “Design Patterns in Ruby” book
  • Mischa Fierer’s three part article about writing a clean Ruby DSL


I’m happy with that list of resources but if anyone has any other suggestions please feel free to comment.

My next challenge is to think about the problem domain and design an elegant syntax.