BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News DSLs bringing the end of single language development?

DSLs bringing the end of single language development?

For many years, mainstream practice in enterprise software development has been to standardize on a single general purpose language on software projects, with Java and C# today being the mainstream choices. With the rise of interest in DSLs, we may be entering into a phase in which multiple languages on software projects becomes the norm, but not with the same problems of the 80’s and early 90’s.

Martin Fowler suggests that  we may be entering such a period in which:
...will see multiple languages used in projects with people choosing a language for what it can do in the same way that people choose frameworks now.
Fowler asserts that "larger frameworks like Hibernate, Struts, ADO present as much of a challenge to learn as a language even if you program them in a single host language." Moreover, expressing needs in the host language might be rather difficult and result in creation of awkward configuration files "which are effectively external DomainSpecificLanguages written in XML".

Embedding DSLs instead of using libraries could be a more appropriate solution. Martin makes the observatoin that "an API is like declaring a vocabulary, a DSL adds a grammar which allows to write coherent sentences." Hence, using DSLs instead of frameworks could be more expressive offering "better ways of manipulating our abstractions" and making it "easier to see what we've written and to reveal our intentions."
 
According to Piers Cawley the main characteristic of DSLs is not their readability but "their narrow focus on their domain" which allows them to be explicit. Illustrating his idea with an example, Cawley shows that DLS can be used not only for having “programs written in them read like domain experts talk” but can also be technical to represent a framework that is best manipulated using their syntax.
 
Neal Ford also believes that momentum is growing for what he refers to as Polyglot Programming. This new era of software development is increasingly characterized by embedding more languages, which allows to choose "the right tool for the job and to leverage it correctly". He gives an example of how difficult concurrency libraries are in java programming language compared to Haskell for example, a functional language that "eliminates side effects on variables " and makes it easier "to write thread-safe code". Ford emphasizes that Haskell implementations exist for both Java (Jaskell) and .NET ( Haskell.net ) .
 
One risk of move away from single language development could be a return to problems in the late 80’s and early 90’s where languages were completely separate platforms which did not interoperate and could not be used well together.  Martin Fowler points out that there will be an important difference this time:
In the late 80's it was hard to get languages to inter-operate closely. These days there's a lot of attention to making environments that allow different language to co-exist closely. Scripting languages have traditionally had an intimate relationship with C. There's much effort to inter-operation on the JVM and CLR platforms. Too much has been invested in libraries for a language to ignore them.
It may finally become a great asset for the industry and also for developers to learn and use multiple languages. According to Pragmatic Programmers, this helps to find new ways to solve problems as it affects the way one thinks about programming. 

What do you think? Will the next 5 years see us mixing languages, and using DSLs almos as frequently as libraries?

Rate this Article

Adoption
Style

BT