I've been reading some papers recently on domain specific languages (DSL), but none of them appear to address the advantages of a DSL over a rich internet application (RIA). In an RIA, instead of learning the domain language, the user is provided with domain objects as form fields, which abstracts the lexical definitions for the domain language. This seems more usable. What I am missing?
|
|
This depends on the complexity of the domain. If it mainly consists of structured data, a visual editor may be more intuitive to use, but if the domain contains significant amounts of logic, experience has shown time and time again that visual editors are a poor tool for that. Additionally, there are some very common, very useful tasks that are trivial with a character-based language (such as copy&paste, search&replace) but require a lot of effort to implement in a visual editor and are therefore often missing. |
|||||||||||||
|
|
A form restricts the possible expressions to just one type. In natural language terms, you can write anything you can imagine in English. What you can express with a form is much more limited: think Mad Libs for example. |
|||
|
|
|
I will be the contrarian and point out that DSLs are often recommended inappropriately, because they are a more natural and flexible interface for programmers, and programmers like to create systems that are easy for themselves to use. That means DSLs are best suited for features designed for programmers or highly trained and specialized users like IT departments. Things like site-specific configuration/customization, script automation, or relatively infrequently-changed business logic. DSLs can also be useful as intermediate representations, allowing the programmer to write code at higher layers in a more compact, better suited language, even if end users never see it. |
|||
|
|
|
Since the DSL is text, I can use text-based tools. Most notably I can generate code for the DSL with a shell script via metaprogramming. As others have said, the DSL doesn't prevent having an RIA as well. |
|||
|
|
|
If you embed the DSL in a full programming language (Python, Ruby, Groovy, etc.) then you can you use the DSL to automate tasks. |
|||
|
|