File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ruby and the fly likes DSL's written in Ruby - a Ruby in Practice query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "DSL Watch "DSL New topic
Author

DSL's written in Ruby - a Ruby in Practice query

Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
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)

Thanks!
Assaf Arkin
Author
Greenhorn

Joined: Feb 09, 2009
Posts: 16
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.
Jeremy McAnally
Author
Greenhorn

Joined: Feb 09, 2009
Posts: 19
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!

Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
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!

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DSL's written in Ruby - a Ruby in Practice query
 
Similar Threads
Ruby in practice question: Do UTF-8 and Ruby fit well in practice?
Why has Ruby gained popularity just recently?
new language
Ruby
Generic vs. DSL