Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
5  
I'm not sure why the two need to be mutually exclusive, but maybe I'm missing something... –  FrustratedWithFormsDesigner May 4 '12 at 15:16
    
@Telastyn I could have just as easily not said RIA, but just said form-based web application. An RIA and a DSL can both be about "information discovery". –  Brian Reindel May 4 '12 at 15:32
    
Ok, define a Yacc-like DSL as a RIA. Or SQL-like DSL. Or a rule engine. –  SK-logic May 4 '12 at 19:26
add comment

5 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
Michael, can you provide an example of a problem domain where the amount of logic might make it better suited for a DSL? –  Brian Reindel May 4 '12 at 15:36
    
Sinatra is considered to be a DSL, shows that you are trying to compare apples and oranges. –  sebastiangeiger May 4 '12 at 15:42
3  
@BrianReindel: Rating insurance policies. –  FrustratedWithFormsDesigner May 4 '12 at 15:43
    
@sebastiangeiger Ruby is not a DSL, and neither is Sinatra. See the answer to this question: stackoverflow.com/questions/2822002/why-is-rails-called-a-dsl. All you have to ask is a simple question: what is the domain? If it is general purpose (web application framework development), then it is a GPL. See the answer that FrustratedWithFormsDesigner gave in the comment above. That would be a better example of a domain. –  Brian Reindel May 4 '12 at 16:06
    
@BrianReindel I never said that ruby was. But (part of) Sinatra is a DSL for defining what actions should be executed if a certain route is accessed. –  sebastiangeiger May 4 '12 at 16:10
show 1 more comment

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.

share|improve this answer
add comment

If you embed the DSL in a full programming language (Python, Ruby, Groovy, etc.) then you can you use the DSL to automate tasks.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.