| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/Domain-specific_programming_language |
A domain-specific language (DSL) is a programming language specialized to a specific application domain. This is in contrast to a general-purpose programming language, which is broadly applicable across domains. There are a wide variety of DSLs, ranging from widely used languages, such as SQL, down to languages used by only one or a few pieces of software, such as MUSH soft code. Simpler DSLs, specifically ones used by a single application, are sometimes informally called mini-languages.
The line between general-purpose languages and domain-specific languages is not always sharp, as a language may have specialized features for a given domain, but be applicable more broadly, or conversely may in principle be capable of broad application but in practice used mainly for a specific domain. For example, Perl was originally developed as a text-processing and glue language, for the same domain as AWK and shell scripts, but was mostly used as a general-purpose programming language later on. In contrast, PostScript is a Turing-complete language, and in principle can be used for any task, but in practice is narrowly used as a page description language.
Metaprogramming can involve the creation and usage of a DSL to generate code. Some languages like Lisp allow modifying their own syntaxes. When doing so, it is common to speak of the creation of a new DSL. Operator overloading, as found in C++, can also create a new DSL.
DSLs are more often declarative than general-purpose languages. Examples of declarative domain specific languages include QML, SQL, XSLT, CSS.
Various business rules engines have been developed for automating policy and business rules used in both government and private industry. ILOG, Oracle Policy Automation, DTRules, Drools and others provide support for DSLs aimed to support various problem domains. DTRules 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 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) coupled with alternatives to programming syntax in favor of DSLs.
Statistical modelers have developed domain-specific languages such as R (an implementation of the S language), Bugs, Jags, and Stan. These languages provide a syntax for describing a Bayesian model and generate a method for solving it using simulation.
Generate object handling and services based on an Interface Description Language for a domain-specific language such as JavaScript for web applications, HTML for documentation, C++ for high-performance code, etc. This is done by cross-language frameworks such as Apache Thrift or Google Protocol Buffers.
Gherkin is a language designed to define test cases to check the behavior of software, without specifying how that behavior is implemented. It is meant to be read and used by non-technical users using a natural language syntax and a line-oriented design. The tests defined with Gherkin must then be implemented in a general programming language. Then, the steps in a Gherkin program acts as a syntax for method invocation accessible to non-developers.
Other prominent examples of domain-specific languages include:
Some of the advantages:
| View original on Wikipedia | Back | FazBrowse Home |