Ruby on Rails is a very successful DSL (Domain Specific Language) written in Ruby. First off, are there any other DSLs written in Ruby that I'm not aware of? Secondly, what's on the fore-front of DSLs for Ruby? From what I understand, it's a great language for just that purpose. Do you think we'll see DSLs for testing, transformation, alternate format creation (Objects to PDF/XML/JSON/DOC/XLS/ETC) - or do you think that the rubygems arena effectively covers this today?
Are there DSLs in specific markets already? (Finance, Education, Health care, Technology, Areospace)
On the testing front, have a look at [url=http://cukes.info/]Cucumber[/url]. It's a BDDt framework that allows you to specify how your application should behave, and then fill out the details to test that behavior. You write the specification in your native language, the code in Ruby.
[url=http://buildr.apache.org/]Buildr[/url] is a build tool that came out of the need for something better than Maven. It uses a DSL for defining projects and build tasks; technically ESDL, since it's a mini-DSL embedded in a host language. In the book we talk about God.rb which has an ESDL to describe monitoring and management of services.
That's just off the top of my head, and yes, I think we'll see a lot more DSLs in the future.
Assaf mentioned two, but you could also take a look at...
The Rails app templates which I wrote. It's a tiny DSL for generating base Rails applications (they'll be integrated in core in the upcoming version 2.3)
RSpec is a great testing DSL. We're seeing giant growth in this area, actually.
Prawn has a lot of DSLs around it that generate PDF's.
I think we'll see a ton more DSLs in the future, and I'm actually going to be talking about DSL design and construction at Mountain West Ruby Conference in March. So if you're interested in the topic, either attend the conference or watch the video on the web afterwards!
Joined: Dec 26, 2003
buildr... nice. Initially I didn't realize that this was for Java projects. My team is just now moving to Maven, and I've got to tell you - the complexity is a sight to behold. Buildr seems like a viable alternative, and I appreciate the fact that you can replace the bloat of ant tasks.
Prawn seems solid, but I dislike using a complex API for layout purposes unless absolutely necessary. HTMLDoc seems like a much more usable option (though one without proper pagination, page-breaks, etc). Still, it reduces the layout API to what we already know (HTML and CSS), and is much faster to implement PDF versions.
The rails app templates are a great idea, something I thought of doing manually or through rake tasks.
Also, I appreciate the heads up on the MW Conf. I went to the site and was (pleasantly) surprised that conference videos were online for 2007/2008. Great support!