DSLs: Let a hundred languages spring forth

Language ‘mashups’ in .NET will become more prominent as use of the .NET DLR expands, said David Laribee. He predicts that Domain-Specific Languages (DSLs) will become more common as developers become polygots, working with many languages. So, perhaps, the DSL is “The Real Juice of the DLR…

By Jack Vaughan
Language mashups in .NET will become more prominent as the use of the .NET DLR expands, David Laribee told attendees last month at ReMIX07Boston. He suggests that developers will, more than ever, become polyglots, using elements of static and dynamic languages as projects require.

We’re polyglots right now, Laribee told TheServerSide Interoperability Blog in a recent e-mail exchange. “In the future we’ll need to know 100 languages,” he said.

“When you think about it, to get your average data-driven web application off the ground you need to know HTML, CSS, C#/VB.NET with ASP.NET (PHP, Rails, etc), JavaScript, various XML dialects, and SQL,” he continued.

With the adoption of Test-Driven Development and scripting languages such as Ruby and Python, Laribee indicated, developers have new options to do work based on language-oriented programming methods. Using multiple languages, developers can employ (or create) domain-specific languages (DSLs) to handle specific problems. Laribee sees teams using “Internal DSLs,” especially for test purposes.

“We see this working in the Ruby on Rails community, as they have lots of little DSLs (migrations, validation ) that work together in orthogonal areas of one application. So when I say that ‘in the future we’ll need to know 100 languages’ what I mean is that we’ll be using straw man frameworks that express the kinds of tasks we do in domain specific languages.”

“These areas don’t have to be particularly large, in fact the DSLs getting attention right now tend to have a laser-like focus,” said Laribee, who is president of Xclaim Software, an ISV offering document, claim, and policy management software.

What is such a laser-focused language? “Haml from the Ruby community springs to mind,” said Laribee. “It’s a little language that expresses HTML in a highly-readable Ruby syntax.”

We asked how much- discussed MonoRail might fit into the scenarios Laribee describes. that as well as LINQ, the extensions to .NET that make queries an integrated feature of Visual Studio for both C# and VB.

LINQ is an example of a DSL, Laribee had told his ReMix07Boston audience. “All of a sudden, you break out into a query language in the middle of you C# code,” he said.

“MonoRail is a Model View Controller framework for .NET web applications inspired by Rails,” he wrote later via e-mail. “I see frameworks as a logical place to start developing DSLs. For example, in your model you can express declarative validation in a somewhat custom syntax. My hope is that MonoRail, which is already an excellent offering, and the forthcoming ASP.NET MVC framework will support the dynamic languages so that more Internal DSLs can be built to express functionality within the viewpoints of the MVC micro-architecture.”

“In my opinion the clearest example of a Domain Specific Language on the .NET platform is LINQ,” Laribee continued. “LINQ is a little language targeted at expressing queries over objects, SQL, XML, really any kind of data for which a developer (or Microsoft) is motivated enough to write an implementation for. It is an Internal DSL.”

Motivation is the keyword, he said. “Internal DSLs have taken off in the open-source community and having a platform that supports this concept is a key driver in growing both the quality and quantity of .NET open source projects. Technologies such as IronRuby, IronPython, and the DLR should provide some fuel for the innovation fire.”

David Laribee Blog - CodeBetter.com
Language-Oriented Programming - Wikipedia

One Response to “DSLs: Let a hundred languages spring forth”

  1. Vivek Saxena Says:

    How are DSLs different compared to Patterns? Or are they Patterns which have been implemented?

Leave a Reply