Domain Specific Languages
August 6, 2009
A domain-specific programming language is a programming language designed for, and intended to be useful for, a specific kind of task.
UNIX shell scripts give a good example of a domain-specific language for data organization. They can manipulate data in files or user input in many different ways.
A domain-specific language is created specifically to solve problems in a particular domain and is not intended to be able to solve problems outside it (although that may be technically possible). The domain can also be a business area. Some examples of business areas include:
- Domain-specific language for life insurance policies developed internally in large insurance enterprise
- Domain-specific language for combat simulation
- Domain-specific language for salary calculation
- Domain-specific language for billing
- Domain-specific languages allow solutions to be expressed in the idiom and at the level of abstraction of the problem domain. Consequently, domain experts themselves can understand, validate, modify, and often even develop domain-specific language programs.
- Self-documenting code.
- Domain-specific languages enhance quality, productivity, reliability, maintainability, portability and reusability.
- Domain-specific languages allow validation at the domain level. As long as the language constructs are safe any sentence written with them can be considered safe.
- Cost of designing, implementing, and maintaining a domain-specific language.
- Finding, setting, and maintaining proper scope.
- Difficulty of balancing trade-offs between domain-specificity and general-purpose programming language constructs.
- Potential loss of processor efficiency compared with hand-coded software.
- Hard or impossible to debug.