InfoQ

News

Interview: Jay Fields and Zak Tamsen on Domain Specific Languages

Posted by Sam Aaron on Oct 28, 2007

Community
Architecture,
Ruby
Topics
Domain Specific Languages ,
Language
Tags
ThoughtWorks ,
Languages ,
Language Oriented Programming ,
Rules Engines

Jay Fields and Zak Tamsen talked with InfoQ about Domain Specific Languages (DSLs), and how they have successfully used them in their projects at ThoughtWorks to empower businesses, reduce development time, and increase the agility of projects.

Watch the full interview with Jay Fields and Zak Tamsen (23 minutes)

In the interview, Jay & Zak describe DSLs as mini languages, written in the language and vocabulary of the domain they are being designed for. This essentially allows the DSL to be as expressive as necessary, yielding real benefits to business users:

“Having an expressive language allows the developer to do things more effectively and more concisely, and present a language to the business users that is a lot simpler for them to use, so they can focus on the actual domain”

Of course, there are also benefits to the DSL designer too. One particular benefit they discuss is that designing a DSL requires the programmer to really understand the domain that they are working within:

“The thing that I like about Domain Specific Languages is that you really learn the domain.”

The difference between internal and external DSLs are also discussed:

“Internal DSL implies that you are actually executing Ruby code, versus an external DSL where you use pre-processing to get it into the Ruby language to then be executed.”

Jay and Zak then describe why they feel that Ruby is such a suitable as a language for creating internal DSLs:

“Ruby [is] concise and [does not require] things such as parentheses or semicolons, giving you a more friendly language for domain experts.”

When asked to compare DSLs with rules engines, they said that rules weren’t always suitable for business users due to their complexity:

“Have you ever sat down with a business user in front of a rules engine?, they are generally very complicated”

To design a DSL is to design a bespoke language tailored specifically for the target domain. Rules engines typically attempt to provide the user with most of the features they require, and achieve the tailoring through extensions. However they describe that this isn’t always simple:

“Rules engines aren’t easily extendable, they can give you features 1 through 100 but you may need 101 and it’s not always an option.”

However, extending a DSL too much was something they didn’t encourage:

“The whole idea of the DSL is to solve a very small focus problem. You can have multiple DSLs within one application, that way it doesn’t become a general purpose language, which would increase the complexity. The more general your language becomes, not only the harder it is to build, the harder it is for the end user to use.”

For a while now, Jay has been blogging about the term Business Natural Language. He describes the problem:

“Everybody has been looking for a way for subject matter experts to specify the business logic”

Zak describes how using a GUI, the traditional approach for achieving this, is not necessarily as intuitive as a text box:

“When subject matter experts talk about their subject matter they don’t actually talk about it in GUI terms, or “I want to click here and move something over here”. They actually talk in English and say “I want to do XYZ if my profit score is a certain number”. They talk in English. I think that for them, once they see it working, the English, the text box, and just writing things that are close to English, is much more natural and more expressive.”

Both Jay and Zak recommend using DSLs written using Business Natural Languages (BNLs) to specify the business logic of applications. They describe how on one project they worked closely with a domain expert to achieve exactly this. They were pleased with how it worked out:

“By the end of the project [the domain expert] was defining the language. We were just working on what the keyword meant, after he came up with it.”

Watch the full interview with Jay Fields and Zak Tamsen (23 minutes)

come senor fernandes by paul kamara Posted Oct 22, 2007 6:08 PM
Punctuation and DSLs by Dirk Ludwig Posted Oct 30, 2007 9:15 AM
  1. Back to top

    come senor fernandes

    Oct 22, 2007 6:08 PM by paul kamara

    obie man
    que pasa aqui?

    this release of the interview you had with jay and zak completely ***** up the timeline !!!

    now on a more positive note could you get jay and zak to look at the tape again and add their comments with regard to thoughtworks 's work with dsl's in the past year
    hay you guys still rock
    but dates are still important too

  2. Back to top

    Punctuation and DSLs

    Oct 30, 2007 9:15 AM by Dirk Ludwig

    "Ruby [is] concise and [does not require] things such as parentheses or semicolons, giving you a more friendly language for domain experts."

    IMHO whether punctuation for DSLs is a good or a bad thing strongly depends updon the domain, the domain experts, and the concrete syntax you are trying to establish. So you cannot say, that host languages which handle punctuation/paranthesis rather lax (e.g. Ruby) are better than others _per se_.

    For example, punctuation would have been a good thing in the comment of mr. kamara :-)

    Regards,
    Dirk

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.