Domain Specific Languages explained
The idea of creating internal DSLs in programming languages has always seemed kind of awkward to me. How can you create a DSL in Lisp for example? It would just be a collection of classes and mehtods/functions that you call - in other words a library or an API and with those pesky parentheses on the top. And to be honest, I’ve never dug any deeper into this subject, because it only seemed a fancy name for an old thing to me.
But yesterday while browsing the most popular Ruby questions on stackoverflow, I found a link to a very nice presentation on DSLs (PDF) by Obie Fernandez. It kind of opened my eyes on what it is all about and, what is more important, nicely showed what were the initial ideas behind RoR. Make it a DSL for writing web applications!
And I really liked this quote from Jamis Buck:
“The fascinating thing is that, in my experience, most well-written Ruby programs are already a DSL, just by nature of Ruby’s syntax.”
I think it really helps to remember what you should expect of yourself when writing a new piece of code in Ruby.
PS. Two years is a pretty nice interval between blog posts, isn’t it? At least a realistic target for me ;). Guess one shouldn’t have taken the “I’ll be writing more about that soon” seriously.
Trackbacks
Use the following link to trackback from your own site:
http://blog.mkolodziej.net/articles/trackback/18665


