Domain-specific programming language
Encyclopedia
In software development
Software development
Software development is the development of a software product...

 and domain engineering
Domain engineering
Domain engineering, also called product line engineering, is the entire process of reusing domain knowledge in the production of new software systems. It is a key concept in systematic software reuse. A key idea in systematic software reuse is the application domain, a software area that contains...

, a domain-specific language (DSL) is a programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 or specification language
Specification language
A specification language is a formal language used in computer science.Unlike most programming languages, which are directly executable formal languages used to implement a system, specification languages are used during systems analysis, requirements analysis and systems design.Specification...

 dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique. The concept isn't new—special-purpose programming languages and all kinds of modeling/specification languages have always existed, but the term has become more popular due to the rise of domain-specific modeling
Domain-Specific Modeling
Domain-specific modeling is a software engineering methodology for designing and developing systems, such as computer software. It involves systematic use of a domain-specific language to represent the various facets of a system...

.

Examples of domain-specific languages include HTML
HTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....

, Logo
Logo (programming language)
Logo is a multi-paradigm computer programming language used in education. It is an adaptation and dialect of the Lisp language; some have called it Lisp without the parentheses. It was originally conceived and written as functional programming language, and drove a mechanical turtle as an output...

 for children, Verilog
Verilog
In the semiconductor and electronic design industry, Verilog is a hardware description language used to model electronic systems. Verilog HDL, not to be confused with VHDL , is most commonly used in the design, verification, and implementation of digital logic chips at the register-transfer level...

 and VHDL
VHSIC Hardware Description Language
VHDL is a hardware description language used in electronic design automation to describe digital and mixed-signal systems such as field-programmable gate arrays and integrated circuits.- History :...

 hardware description languages, Mata for matrix programming, Mathematica
Mathematica
Mathematica is a computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing...

 and Maxima for symbol
Symbol
A symbol is something which represents an idea, a physical entity or a process but is distinct from it. The purpose of a symbol is to communicate meaning. For example, a red octagon may be a symbol for "STOP". On a map, a picture of a tent might represent a campsite. Numerals are symbols for...

ic mathematics
Mathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...

, spreadsheet
Spreadsheet
A spreadsheet is a computer application that simulates a paper accounting worksheet. It displays multiple cells usually in a two-dimensional matrix or grid consisting of rows and columns. Each cell contains alphanumeric text, numeric values or formulas...

 formulas and macros, SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 for relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

 queries, YACC
Yacc
The computer program yacc is a parser generator developed by Stephen C. Johnson at AT&T for the Unix operating system. The name is an acronym for "Yet Another Compiler Compiler." It generates a parser based on an analytic grammar written in a notation similar to BNF.Yacc used to be available as...

 grammars for creating parsers, regular expressions for specifying lexers
Lexical analysis
In computer science, lexical analysis is the process of converting a sequence of characters into a sequence of tokens. A program or function which performs lexical analysis is called a lexical analyzer, lexer or scanner...

, the Generic Eclipse Modeling System
Generic Eclipse Modeling System
Generic Eclipse Modeling System is a configurable toolkit for creating domain-specific modeling and program synthesis environments for Eclipse...

 for creating diagramming languages, Csound
Csound
Csound is a computer programming language for dealing with sound, also known as a sound compiler or an audio programming language, or more precisely, a C-based audio DSL. It is called Csound because it is written in C, as opposed to some of its predecessors...

 for sound and music synthesis, and the input languages of GraphViz
Graphviz
Graphviz is a package of open-source tools initiated by AT&T Labs Research for drawing graphs specified in DOT language scripts. It also provides libraries for software applications to use the tools...

 and GrGen
GrGen
GrGen.NET is a graph transformation tool which generates efficient C#-code out of declarative graph rewrite rule specifications....

, software packages used for graph layout and graph rewriting
Graph rewriting
Graph transformation, or Graph rewriting, concerns the technique of creating a new graph out of an original graph using some automatic machine. It has numerous applications, ranging from software verification to layout algorithms....

.

The opposite is:
  • a general-purpose programming language
    General-purpose programming language
    In computer software a general-purpose programming language is a programming language designed to be used for writing software in a wide variety of application domains...

    , such as C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

    , Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

     or Python
    Python (programming language)
    Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

    ,
  • or a general-purpose modeling language such as the Unified Modeling Language (UML
    Unified Modeling Language
    Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

    ).


Creating a domain-specific language (with software to support it) can be worthwhile if the language allows a particular type of problem or solution to be expressed more clearly than an existing language would allow and the type of problem in question reappears sufficiently often. Language-Oriented Programming
Language-oriented programming
Language oriented programming is a style of computer programming in which, rather than solving problems in general-purpose programming languages, the programmer creates one or more domain-specific languages for the problem first, and solves the problem in those languages...

 considers the creation of special-purpose languages for expressing problems a standard part of the problem solving process.

Overview

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). In contrast, general-purpose languages are created to solve problems in many domains. 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


A domain-specific language is somewhere between a tiny programming language and a scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

, and is often used in a way analogous to a programming library. The boundaries between these concepts are quite blurry, much like the boundary between scripting languages and general-purpose languages.

In design and implementation

Domain-specific languages are languages (or often, declared syntaxes or grammars) with very specific goals in design and implementation. A domain-specific language can be one of a visual diagramming language, such as those created by the Generic Eclipse Modeling System
Generic Eclipse Modeling System
Generic Eclipse Modeling System is a configurable toolkit for creating domain-specific modeling and program synthesis environments for Eclipse...

, programmatic abstractions, such as the Eclipse Modeling Framework
Eclipse Modeling Framework
Eclipse Modeling Framework is an Eclipse-based modeling framework and code generation facility for building tools and other applications based on a structured data model...

, or textual languages. For instance, the command line utility grep
Grep
grep is a command-line text-search utility originally written for Unix. The name comes from the ed command g/re/p...

 has a regular expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...

 syntax which matches patterns in lines of text. The sed
Sed
sed is a Unix utility that parses text and implements a programming language which can apply transformations to such text. It reads input line by line , applying the operation which has been specified via the command line , and then outputs the line. It was developed from 1973 to 1974 as a Unix...

 utility defines a syntax for matching and replacing regular expressions. Often, these tiny languages can be used together inside a shell to perform more complex programming tasks.

The line between domain-specific languages and scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

s is somewhat blurred, but domain-specific languages often lack low-level functions for filesystem access, interprocess control, and other functions that characterize full-featured programming languages, scripting or otherwise. Many domain-specific languages do not compile to byte-code or executable code, but to various kinds of media objects: GraphViz exports to PostScript
PostScript
PostScript is a dynamically typed concatenative programming language created by John Warnock and Charles Geschke in 1982. It is best known for its use as a page description language in the electronic and desktop publishing areas. Adobe PostScript 3 is also the worldwide printing and imaging...

, GIF
GIF
The Graphics Interchange Format is a bitmap image format that was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web due to its wide support and portability....

, JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....

, etc., where Csound
Csound
Csound is a computer programming language for dealing with sound, also known as a sound compiler or an audio programming language, or more precisely, a C-based audio DSL. It is called Csound because it is written in C, as opposed to some of its predecessors...

 compiles to audio files, and a ray-tracing domain-specific language like POV
POV-Ray
The Persistence of Vision Raytracer, or POV-Ray, is a ray tracing program available for a variety of computer platforms. It was originally based on DKBTrace, written by David Kirk Buck and Aaron A. Collins. There are also influences from the earlier Polyray raytracer contributed by its author...

 compiles to graphics files. A computer language like SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 presents an interesting case: it can be deemed a domain-specific language because it is specific to a specific domain (in SQL's case, accessing and managing relational databases), and is often called from another application, but SQL has more keywords and functions than many scripting languages, and is often thought of as a language in its own right, perhaps because of the prevalence of database manipulation in programming and the amount of mastery required to be an expert in the language.

Further blurring this line, many domain-specific languages have exposed APIs, and can be accessed from other programming languages without breaking the flow of execution or calling a separate process, and can thus operate as programming libraries.

Programming tools

Some domain-specific languages expand over time to include full-featured programming tools, which further complicates the question of whether a language is domain-specific or not. A good example is the functional language XSLT
XSLT
XSLT is a declarative, XML-based language used for the transformation of XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one. The new document may be serialized by the processor in standard XML syntax or in another format,...

, specifically designed for transforming one XML graph into another, which has been extended since its inception to allow (particularly in its 2.0 version) for various forms of filesystem interaction, string and date manipulation, and data typing.

In model-driven engineering
Model-driven engineering
Model-driven engineering is a software development methodology which focuses on creating and exploiting domain models , rather than on the computing concepts...

 many examples of domain-specific languages may be found like OCL
Object Constraint Language
The Object Constraint Language is a declarative language for describing rules that apply to Unified Modeling Language models developed at IBM and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object...

, a language for decorating models with assertions or QVT
QVT
QVT is a standard set of languages for model transformation defined by the Object Management Group .- Overview :...

, a domain specific transformation language. However languages like UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 are typically general purpose modeling languages.

To summarize, an analogy might be useful: a Very Little Language is like a knife, which can be used in thousands of different ways, from cutting food to cutting down trees. A domain-specific language is like an electric drill: it is a powerful tool with a wide variety of uses, but a specific context, namely, putting holes in things. A General Purpose Language is a complete workbench, with a variety of tools intended for performing a variety of tasks. Domain-specific languages should be used by programmers who, looking at their current workbench, realize they need a better drill, and find that a particular domain-specific language provides exactly that.

Usage patterns

There are several usage patterns for domain-specific languages:
  • processing with standalone tools, invoked via direct user operation, often on the command line or from a Makefile (e.g., the GraphViz
    Graphviz
    Graphviz is a package of open-source tools initiated by AT&T Labs Research for drawing graphs specified in DOT language scripts. It also provides libraries for software applications to use the tools...

     tool set)
  • domain-specific languages which are implemented using programming language macro systems, and which are converted or expanded into a host general purpose language at compile-time or read-time
  • embedded (or internal) domain-specific languages, implemented as libraries which exploit the syntax of their host general purpose language or a subset thereof, while adding domain-specific language elements (data types, routines, methods, macros etc.).
  • domain-specific languages which are called (at runtime) from programs written in general purpose languages like C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

     or Perl
    Perl
    Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

    , to perform a specific function, often returning the results of operation to the "host" programming language for further processing; generally, an interpreter or virtual machine
    Virtual machine
    A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

     for the domain-specific language is embedded into the host application
  • domain-specific languages which are embedded into user applications (e.g., macro languages within spreadsheets) and which are (1) used to execute code that is written by users of the application, (2) dynamically generated by the application, or (3) both.


Many domain-specific languages can be used in more than one way.

Design goals

Adopting a domain-specific language approach to software engineering involves both risks and opportunities. The well-designed domain-specific language manages to find the proper balance between these.

Domain-specific languages have important design goals that contrast with those of general-purpose languages:
  • domain-specific languages are less comprehensive.
  • domain-specific languages are much more expressive in their domain.
  • domain-specific languages should exhibit minimum redundancy according to the following subjective definition.

Redundancy of a program is defined as the average number of textual insertions, deletions, or replacements necessary to correctly implement a single stand-alone change in requirements. For a language, this is averaged over programs in the problem domain. This measure is useful because, the smaller it is, the less likely that bugs can be introduced by incompletely implementing changes.

Idioms

In programming, idioms are methods imposed by programmers to handle common development tasks, e.g.:
  • Ensure data is saved before the window is closed.
  • Before conducting expensive tests, perform cheap tests that can rule out need for expensive tests.
  • Edit code whenever command-line parameters change because they affect program behavior.


General purpose programming languages rarely support such idioms, but domain-specific languages can describe them, e.g.:
  • A script can automatically save data.
  • A smart test harness can learn what good tests are.
  • A domain-specific language can parameterize command line input.

Unix shell scripts

Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 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. Domain abstractions and notations include streams (such as stdin and stdout) and operations on streams (such as redirection and pipe). These abstractions combine to make a robust language to talk about the flow and organization of data.

The language consists of a simple interface (a script) for running and controlling processes that perform small tasks. These tasks represent the idioms of organizing data into a desired format such as tables, graphs, charts, etc.

These tasks consist of simple control-flow and string manipulation mechanisms that cover a lot of common usages like searching and replacing string in files, or counting occurrences of strings (frequency counting).

Even though Unix scripting languages are Turing complete, they differ from general purpose languages.

In practice, scripting languages are used to weave together small Unix tools such as AWK (e.g., gawk), ls
Ls
In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification.- History :An ls utility appeared in the original version of AT&T UNIX...

, sort
Sort (Unix)
sort is a standard Unix command line program that prints the lines of its input or concatenation of all files listed in its argument list in sorted order. Sorting is done based on one or more sort keys extracted from each line of input. By default, the entire input is taken as sort key...

 or wc
Wc (Unix)
wc is a command in Unix-like operating systems.The program reads either standard input or a list of files and generates one or more of the following statistics: number of bytes, number of words, and number of lines...

.

ColdFusion Markup Language

ColdFusion
ColdFusion
In computing, ColdFusion is the name of a commercial rapid application development platform invented by Jeremy and JJ Allaire in 1995. ColdFusion was originally designed to make it easier to connect simple HTML pages to a database, by version 2 it had...

's associated scripting language is another example of a domain-specific language for data-driven websites.
This scripting language is used to weave together languages and services such as Java, .NET, C++, SMS, email, email servers, http, ftp, exchange, directory services, and file systems for use in websites.

The ColdFusion Markup Language
ColdFusion Markup Language
ColdFusion Markup Language, more commonly known as CFML, is a scripting language for web development that runs on the JVM, the .NET framework, and Google App Engine...

 includes a set of tags that can be used in ColdFusion pages to interact with data
sources, manipulate data, and display output. CFML tag syntax is similar to HTML element syntax.

Erlang OTP

The Erlang Open Telecom Platform was originally designed for use inside Ericsson as a domain specific language. The language itself offers a platform of libraries to create finite state machines, generic servers and event managers that quickly allow an engineer to deploy applications, or support libraries, that have been shown in industry benchmarks to outperform other languages intended for a mixed set of domains, such as C and C++. The language is now officially open source and can be downloaded from their website.

FilterMeister

FilterMeister is a programming environment, with a programming language that is based on C, for the specific purpose of creating Photoshop-compatible image processing filter plug-ins; FilterMeister runs as a Photoshop plug-in itself and it can load and execute scripts or compile and export them as independent plug-ins.
Although the FilterMeister language reproduces a significant portion of the C language and function library, it contains only those features which can be used within the context of Photoshop plug-ins and adds a number of specific features only useful in this specific domain.

MediaWiki templates

The Template feature of MediaWiki
MediaWiki
MediaWiki is a popular free web-based wiki software application. Developed by the Wikimedia Foundation, it is used to run all of its projects, including Wikipedia, Wiktionary and Wikinews. Numerous other wikis around the world also use it to power their websites...

 is an embedded domain-specific language whose fundamental purpose is to support the creation of page templates and the transclusion (inclusion by reference) of MediaWiki pages into other MediaWiki pages.

A detailed description of that domain-specific language can be found at the corresponding article at the Wikimedia Foundation's Meta-Wiki.

Software engineering uses

There has been much interest in domain-specific languages to improve the productivity and quality of software engineering
Software engineering
Software Engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software...

. Domain-specific language could possibly provide a robust set of tools for efficient software engineering. Such tools are beginning to make their way into development of critical software systems.

The Software Cost Reduction Toolkit http://chacs.nrl.navy.mil/publications/CHACS/1998/1998heitmeyer-WIFT.pdf is an example of this. The toolkit is a suite of utilities including a specification editor to create a requirements specification
Requirements specification
Requirements specification in systems engineering and software engineering is the direct result of a requirement analysis and can refer to*Software Requirements Specification*Hardware Requirements Specificationor both.-See also:*Design specification...

, a dependency graph browser to display variable dependencies, a consistency checker to catch missing cases in well-formed formula
Well-formed formula
In mathematical logic, a well-formed formula, shortly wff, often simply formula, is a word which is part of a formal language...

s in the specification, a model checker and a theorem prover to check program properties against the specification, and an invariant generator that automatically constructs invariants based on the requirements.

A newer development is Language-oriented programming
Language-oriented programming
Language oriented programming is a style of computer programming in which, rather than solving problems in general-purpose programming languages, the programmer creates one or more domain-specific languages for the problem first, and solves the problem in those languages...

, an integrated software engineering methodology based mainly on creating, optimizing, and using domain-specific languages.

Metacompilers

Complementing language-oriented programming, as well as all other forms of domain-specific languages, are the class of compiler writing tools called metacompiler
Metacompiler
Metacompilers are a subset of a specialized class of compiler writing toolscalled compiler-compilers.The feature that sets a metacompiler apart from a standard compiler-compileris that a metacompiler is written in its own language and translates itself....

s. A metacompiler is not only useful for generating parsers and code generators for domain specific languages, but a metacompiler is also itself a domain-specific language for the domain of compiler writing. The feature that sets a metacompiler apart from a standard compiler-compiler
Compiler-compiler
A compiler-compiler or compiler generator is a tool that creates a parser, interpreter, or compiler from some form of formal description of a language and machine...

 is that a metacompiler is written in its own language and translates itself—the grammar productions defining itself written in its own specialized language—into the executable form of itself. Defining itself and translating itself constitute the meta-step that sets a metacompiler apart from other compiler-compilers.

Besides parsing domain-specific languages, metacompilers are useful for generating a wide range of software engineering and analysis tools. The meta-compiler methodology of self-regeneration for the purpose of bootstrapping generic tool building tools are often found in program transformation systems
Program transformation
A program transformation is any operation that takes a computer program and generates another program. In many cases the transformed program is required to be semantically equivalent to the original, relative to a particular formal semantics and in fewer cases the transformations result in programs...

.

Metacompilers that played a significant role in both computer science and the computer industry include Meta-II
META II
META II is a compiler writing language first released in 1962 by D. V. Schorre. It consists of syntax equations resembling Backus normal form and into which instructions to output assembly language commands are inserted. Compilers have been written in this language for VALGOL I and VALGOL II...

 and its descendent TreeMeta
TREE-META
The TREE-META Translator Writing System is a Compiler-compiler system for context-free languages originally developed in the 1960s. Parsing statements of the metalanguage resemble Backus-Naur Form with embedded tree-building directives...

.

Unreal Engine and other games

Unreal
Unreal
Unreal is a first-person shooter video game developed by Epic MegaGames and Digital Extremes and published by GT Interactive in May 1998...

 and Unreal Tournament
Unreal Tournament
Unreal Tournament is a futuristic first-person shooter video game co-developed by Epic Games and Digital Extremes. It was published in 1999 by GT Interactive. Retrospectively, the game has also been referred to as UT99 or UT Classic to differentiate it from its numbered sequels...

 unveiled a language called UnrealScript
UnrealScript
UnrealScript is the scripting language of the Unreal Engine and is used for authoring game code and gameplay events....

. This allowed for rapid development of modifications compared to the competitor Quake (using the Id Tech engine). The Id Tech engine uses standard C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

  code meaning C had to be learned and properly applied, while UnrealScript was optimized for ease of use and efficiency. Similarly, the development of more recent games introduced their own specific languages, one more common example is Lua for scripting.

Rules Engines for Policy Automation

Various Business Rules Engines
Business rules engine
A business rules engine is a software system that executes one or more business rules in a runtime production environment. The rules might come from legal regulation , company policy , or other sources...

 have been developed for automating policy and business rules used in both government and private industry. ILOG
ILOG
ILOG is an international software company owned by IBM. It creates enterprise software products for supply chain, business rule management, visualization and optimization....

, Oracle Policy Automation
Oracle Policy Automation
In computing, Oracle Policy Automation is a suite of software products for modeling and deploying business rules within enterprise applications. Oracle Corporation acquired OPA in December 2008 when it purchased Australian software company RuleBurst Holdings, then trading as Haley...

, DTRules
DTRules
DTRules is Open Sourced Rules Engine written entirely in Java. DTRules executes Decision tables directly, and utilizes a Domain Specific Language for expressing the conditions and actions within the Decision Tables....

, Drools
Drools
Drools is a business rule management system with a forward chaining inference based rules engine, more correctly known as a production rule system, using an enhanced implementation of the Rete algorithm....

 and others provide support for DSLs aimed to support various problem domains. DTRules
DTRules
DTRules is Open Sourced Rules Engine written entirely in Java. DTRules executes Decision tables directly, and utilizes a Domain Specific Language for expressing the conditions and actions within the Decision Tables....

 goes so far as to define an interface for the use of multiple DSLs within a Rule Set.

The purpose of Business Rules Engines is to define a representation of business logic in as human readable fashion as possible. This allows both subject matter experts
Subject-matter expert
A subject matter expert or domain expert is a person who is an expert in a particular area or topic. When spoken, sometimes the acronym "SME" is spelled out and other times voiced as a word ....

 and developers to work with and understand the same representation of the business logic. Most Rules Engines provide both an approach to simplifying the control structures for business logic (for example, using Declarative Rules or Decision Tables
Decision table
Decision tables are a precise yet compact way to model complicated logic.Decision tables, like flowcharts and if-then-else and switch-case statements, associate conditions with actions to perform, but in many cases do so in a more elegant way....

) coupled with alternatives to programming syntax in favor of DSLs.

Advantages and disadvantages

Some of the advantages:
  • Domain-specific languages allow solutions to be expressed in the idiom and at the level of abstraction of the problem domain. The idea is domain experts themselves may understand, validate, modify, and often even develop domain-specific language programs. However, this is seldom the case.
  • Self-documenting code.
  • Domain-specific languages enhance quality, productivity, reliability, maintainability
    Maintainability
    In engineering, maintainability is the ease with which a product can be maintained in order to:* isolate defects or their cause* correct defects or their cause* meet new requirements* make future maintenance easier, or* cope with a changed environment...

    , portability and reusability
    Reusability
    In computer science and software engineering, reusability is the likelihood a segment of source code that can be used again to add new functionalities with slight or no modification...

    .
  • Domain-specific languages allow validation
    Computer security
    Computer security is a branch of computer technology known as information security as applied to computers and networks. The objective of computer security includes protection of information and property from theft, corruption, or natural disaster, while allowing the information and property to...

     at the domain level. As long as the language constructs are safe any sentence written with them can be considered safe.


Some of the disadvantages:
  • Cost of learning a new language vs. its limited applicability
  • Cost of designing, implementing, and maintaining a domain-specific language as well as the tools required to develop with it (IDE
    Integrated development environment
    An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

    )
  • 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
    Algorithmic efficiency
    In computer science, efficiency is used to describe properties of an algorithm relating to how much of various types of resources it consumes. Algorithmic efficiency can be thought of as analogous to engineering productivity for a repeating or continuous process, where the goal is to reduce...

     compared with hand-coded software.
  • Proliferation of similar non-standard domain specific languages, i.e. a DSL used within insurance company A versus a DSL used within insurance company B.
  • Non-technical domain experts can find it hard to write or modify DSL programs by themselves.
  • Increased difficulty of integrating the DSL with other components of the IT system (as compared to integrating with a general-purpose language).
  • Low supply of experts in a particular DSL tends to raise labor costs.
  • Harder to find code examples.

See also

  • Architecture description language
    Architecture description language
    Different communities use the term architecture description language. Some important communities are the system engineering community, the software engineering community and the enterprise modelling and engineering community...

  • Combinator library
    Combinator library
    A combinator library is a software library which implements combinators for a functional programming language; "the key idea is this: a combinator library offers functions that combine functions together to make bigger functions"...

  • Cognitive dimensions of notations
  • Domain analysis
    Domain analysis
    In software engineering, domain analysis, or product line analysis, is the process of analyzing related software systems in a domain to find their common and variable parts. It is a model of wider business context for the system. The term was coined in the early 1980s by James Neighbors. Domain...

  • Domain-specific entertainment language
  • Domain-specific modeling
    Domain-Specific Modeling
    Domain-specific modeling is a software engineering methodology for designing and developing systems, such as computer software. It involves systematic use of a domain-specific language to represent the various facets of a system...

  • Domain-specific multimodeling
    Domain-specific multimodeling
    Domain-specific multimodelingis a software development paradigm where each view is made explicit as a separate domain-specific language .Successful development of a modern enterprise system requires the convergence of multiple views...

  • Fluent interface
    Fluent interface
    In software engineering, a fluent interface is an implementation of an object oriented API that aims to provide for more readable code....

  • Metacompiler
    Metacompiler
    Metacompilers are a subset of a specialized class of compiler writing toolscalled compiler-compilers.The feature that sets a metacompiler apart from a standard compiler-compileris that a metacompiler is written in its own language and translates itself....

  • Metalinguistic abstraction
    Metalinguistic abstraction
    In computer science, metalinguistic abstraction is the process of solving complex problems by creating a new language or vocabulary to better understand the problem space...

  • Metamodeling
    Metamodeling
    Metamodeling, or meta-modeling in software engineering and systems engineering among other disciplines, is the analysis, construction and development of the frames, rules, constraints, models and theories applicable and useful for modeling a predefined class of problems...

  • Model-driven engineering
    Model-driven engineering
    Model-driven engineering is a software development methodology which focuses on creating and exploiting domain models , rather than on the computing concepts...

  • Multi-paradigm programming language
    Multi-paradigm programming language
    Programming languages can be grouped by the number and types of paradigms supported.-Paradigm summaries:A concise reference for the programming paradigms listed in this article....

  • Papyrus
    Papyrus (software)
    Papyrus is an Open Source UML 2 tool based on Eclipse and licensed under the EPL. It can either be used as a standalone tool or as an Eclipse plugin. Papyrus provides support for Domain Specific Languages and SysML.-UML2:...

  • Programming domain
    Programming domain
    A programming domain defines a specific kind of use for a programming language.Some examples of programming domains are:*General purpose applications* Rapid software prototyping*Financial time series analysis*Natural language processing...

  • Programming paradigm
    Programming paradigm
    A programming paradigm is a fundamental style of computer programming. Paradigms differ in the concepts and abstractions used to represent the elements of a program and the steps that compose a computation A programming paradigm is a fundamental style of computer programming. (Compare with a...

  • REBOL
    REBOL
    REBOL is a cross-platform data exchange language and a multi-paradigm dynamic programming language originally designed by Carl Sassenrath for network communications and distributed computing. The language and its official implementation, which is a proprietary freely redistributable software are...

  • Sinatra
    Sinatra (software)
    Sinatra is a free and open source web application library and domain-specific language written in Ruby. It is an alternative to other Ruby web application frameworks such as Ruby on Rails, Merb, Nitro, Camping, and Rango. It is dependent on the Rack web server interface.Designed and developed by...

  • EMML

Further reading

  • Dunlavey, "Building Better Applications: a Theory of Efficient Software Development" International Thomson Publishing ISBN 0-442-01740-5, 1994.
  • Constance Heitmeyer. Using the SCR Toolset to Specify Software Requirements. Proceedings, Second IEEE Workshop on Industrial Strength Formal Specification Techniques, Boca Raton, FL, Oct. 19, 1998.
  • Marjan Mernik, Jan Heering, and Anthony M. Sloane. When and how to develop domain-specific languages. ACM Computing Surveys, 37(4):316–344, 2005. doi:10.1145/1118890.1118892
  • Diomidis Spinellis. Notable design patterns for domain specific languages. Journal of Systems and Software, 56(1):91–99, February 2001. doi:10.1016/S0164-1212(00)00089-3
  • Terence Parr. The Definitive ANTLR Reference: Building Domain-Specific Languages. ISBN 978-0-9787-3925-6
  • James Larus. Spending Moore's Dividend. ISSN:0001-0782. Communications of the ACM. Volume 52, Issue 5 (May 2009).
  • Martin Fowler. Domain Specific Languages. ISBN 978-0-321-71294-3

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK