Skip to content

Domain Specific Languages

Fábio Nogueira edited this page Mar 17, 2017 · 2 revisions

A Domain-Specific Language is a language that provides constructs and notations tailored to an application domain [Mernik]. The idea behind the proposition of a DSL is to easy application development by using a language that is optimized for a class of problems, referred to as a domain. In fact, is supposed to embed abstractions that are closely aligned to the domain to which the language was designed. In this context, we say that the use of a DSL enables a natural reduction of the gap between the domain concepts and the language used to specify the applications. DSLs are usually small, declarative and are not required to be Turing Complete.

A DSL can be computational (executable) or compositional (nonexecutable). In terms of the design, this decision can be based on the nature of the subjects that are intended to be represented (modeled) by the language. If this subject is a product, the DSL will be nonexecutable, whereas, if this subject is more like a process, the language should be executable in nature. Executable DSLs can be [Cariou]:

  • Compiled: constructs are translated to base language constructs and library calls
  • Interpreted: constructs are interpreted based on an operational semantics embedded on an execution engine

Elements of a Language definition (Based on Meaningful Modeling: What's the Semantics of "Semantics"?)

A DSL is obviously a language. So, in order to design a DSL it is firstly necessary to precisely define what exactly compose a language definition. As defined by [Harel], "A language consists of a syntactic notation (syntax), which is a possibly infinite set of legal elements, together with the meaning of those elements, which is expressed by relating the syntax to a semantic domain. Thus, any language definition must consists of the syntax, semantic domain, and semantic mapping from the syntactic elements to the semantic domain".

Clone this wiki locally