A computer language like SQL 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.įurther 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. Many domain-specific languages do not compile to byte-code or executable code, but to various kinds of media objects: GraphViz exports to PostScript, GIF, JPEG, etc., where Csound compiles to audio files, and a ray-tracing domain-specific language like POV compiles to graphics files. The line between domain-specific languages and scripting languages 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. Often, these tiny languages can be used together inside a shell to perform more complex programming tasks. The sed utility defines a syntax for matching and replacing regular expressions. For instance, the command line utility grep has a regular expression syntax which matches patterns in lines of text. A domain-specific language can be one of a visual diagramming language, such as those created by the Generic Eclipse Modeling System, programmatic abstractions, such as the Eclipse Modeling Framework, or textual languages. In design and implementationĭomain-specific languages are languages (or often, declared syntaxes or grammars) with very specific goals in design and implementation.
The boundaries between these concepts are quite blurry, much like the boundary between scripting languages and general-purpose languages. domain-specific language for salary calculationĪ domain-specific language is somewhere between a tiny programming language and a scripting language, and is often used in a way analogous to a programming library.domain-specific language for combat simulation.domain-specific language for life insurance policies developed internally in large insurance enterprise.In contrast, general-purpose languages are created to solve problems in many domains. 3.9 Rules Engines for Policy AutomationĪ 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).
Language-Oriented Programming considers the creation of special-purpose languages for expressing problems a standard part of the problem solving process.
Domain specific languages martin fowler rebecca parsonspdf software#
or a general-purpose modeling language such as the Unified Modeling Language ( UML).Ĭreating 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 languages would allow and the type of problem in question reappears sufficiently often.a general-purpose programming language, such as C, Java or Python,.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.Įxamples of domain-specific languages include HTML, Logo for children, Verilog and VHDL hardware description languages, Mata for matrix programming, Mathematica and Maxima for symbolic mathematics, spreadsheet formulas and macros, SQL for relational database queries, YACC grammars for creating parsers, regular expressions for specifying lexers, the Generic Eclipse Modeling System for creating diagramming languages, Csound for sound and music synthesis, and the input languages of GraphViz and GrGen, software packages used for graph layout and graph rewriting. In software development and domain engineering, a domain-specific language ( DSL) is a programming language or specification language dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique.