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.
Tutorials
- 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
Examples
- Pete Yandell’s machinist
- Javan Makhmali’s whenever, which provides a clean Ruby syntax for defining cron jobs
- Ben Schwarz’s smoke (also see this video)
- Marcus Crafter’s sprinkle (also see this presentation)
- Cucumber, the behaviour driven development 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.
Navigation
Latest Blog Posts
- 24 Jun 2011: Rails Camp 9
- 13 May 2011: Committed Stand-Ups
- 27 Apr 2011: On Agile
- 5 Apr 2011: Maintaining a Legacy Rails App
- 4 Mar 2011: Reflections on YOW 2010 Conference
Syndication
Tags
agile bundler capgun capistrano community conference consulting css deployment dsl estimation jaoo javascript legacy apps osdc pdf planning prawn rails railscamp reflections rorosyd ruby ruby tracker rubygems rvm standups syntax highlighting testing unconference wds08 xml yow
Comments
None yet.
Post a Comment
Please use your real name and be respectful. Textile formatting is supported.