By Peter Bell

In Praise of Horizontal DSLs

While much of the interest in Domain Specific Languages (DSL's) is in developing vertical DSL's that correspond to a specific problem domain (shipping, reservation systems, insurance, etc.) there are huge productivity benefits to be gained by developing and using horizontal DSL's that correspond to a solution domain for improving the expressiveness of your code . . .

The problem with DSL’s is that they are fundamentally hard to design well. There are various tools both available and in development designed to reduce the accidental difficulties of domain specific language design through better tooling, but language design has substantial essential difficulty – it is hard to design good languages, so you really have to use them a lot to get a return on your investment.

The problem at SystemsForge is that we seldom work on projects with budgets sufficient to do deep domain modeling and DSL development. Because of that, most of the DSLs we develop are horizontal so we can reuse them across projects and domains.

We have all come across horizontal DSL’s. The two most commonly quoted examples are SQL and Regular Expressions – both of which are vertical domain independent (you can use them for an insurance policy calculator or a newsletter publishing system) but are clearly hortizontal domain specific (try to define a user interface with SQL or to write a complete data import routine using a RegEx).

At SystemsForge we’ve been developing a bunch of DSL’s for specifying web applications. If you look at any website generation system, you’ll see a lot of commonalities between their approaches. Most of them allow you to describe an object model and a set of screens as that is the most efficient way of specifying the functionality required by most web apps. We have been developing a set of DSLs for objects, properties, relationships, screens, actions, steps, custom data types, validations, transformations and the like to make it easier to generate sites and I’ll be refining and posting those over the next couple of weeks in the run up to my presentation at Frameworks where I’ll be explaining exactly how to generate sites.

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.005.