Ruby, DSLs and the free lunch that was not so free

By  

About a decade ago, the world of IT underwent a period of language creation hype. At the center of that hype was XML. The power attributed to XML stemmed in large part from the fact that it was not a language in the ordinary sense. It was a language for creating languages - known as schemas or DTDs - for any domain you liked: recipes, stock quotes, washing machine documentation, and so on.

Fast forward to today and the world of IT is embarking, I suspect, on a another period of language creation hype. This time, the hype epicenter is Ruby and the facilities it provides to create custom languages. The word "schema" now exits stage left and the acronym "DSL" (domain-specific language) enters stage right. As a language-oriented (as distinct to mathematically-oriented) IT person, I am as happy as a clam about this. I have got the popcorn, the gallon drum of soda and I'm settling into my easy-chair for what should be a fascinating show. The question on the game show is this: DSL or schema? Is the right answer, "DSL", "schema", "neither", "both" or the classic : "it depends"? Fingers on buzzers...

As an incurable predictor of IT futures, I also cannot help but predict the outcome. I think the answer is that all time classic "it depends". However, before the world settles on that answer, it will need to pass through a trough of disillusionment about DSLs. I think that trough will come soon. I think it will come hard and steep; I'm not sure that Ruby - an excellent general purpose programming language - will come out well at the and of it all. But, hey, I have been wrong before! Herewith is my reasoning. I welcome all constructive feedback and discussion. I have split the discussion into a number of necessarily overlapping areas...

1 - the inevitable language learning curve and when you need to climb it

Most successful general purpose programming languages of recent times have had a flexible verb/noun system and a fixed sentential form system. By that I mean that most common programming languages allow the creation of new nouns e.g., objects, variables, record structures and verbs e.g. functions, procedures. Object oriented programming languages allow the creation of verbs in the context of nouns: methods. However, for the most part, the sentential forms of most heretofore successful general purpose programing languages have been fixed. That is, if you need to repeat something; do something based on a condition; or decompose your program into manageable pieces; the language only provides a fixed set of sentential forms. You cannot roll your own.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness