domain a domainspecific language dsl is a computer language specialized to a particular application domain this is in contrast to a generalpurpose language gpl which is broadly applicable across domains there are a wide variety of dsls ranging from widely used languages for common domains such as html for web pages down to languages used by only one or a few pieces of software such as mush soft code dsls can be further subdivided by the kind of language and include domainspecific markup languages domainspecific modeling languages more generally specification languages and domainspecific programming languages specialpurpose computer languages have always existed in the computer age but the term domainspecific language has become more popular due to the rise of domainspecific modeling simpler dsls particularly ones used by a single application are sometimes informally called minilanguages the line between generalpurpose languages and domainspecific languages is not always sharp as a language may have specialized features for a particular domain but be applicable more broadly or conversely may in principle be capable of broad application but in practice used primarily for a specific domain for example perl was originally developed as a textprocessing and glue language for the same domain as awk and shell scripts but was mostly used as a generalpurpose programming language later on by 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 use the design and use of appropriate dsls is a key part of domain engineering by using a language suitable to the domain at hand this may consist of using an existing dsl or gpl or developing a new dsl languageoriented programming considers the creation of specialpurpose languages for expressing problems as standard part of the problem solving process creating a domainspecific language with software to support it rather than reusing an existing language 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 pragmatically a dsl may be specialized to a particular problem domain a particular problem representation technique a particular solution technique or other aspect of a domain overview a domainspecific 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 generalpurpose languages are created to solve problems in many domains the domain can also be a business area some examples of business areas include domainspecific language for life insurance policies developed internally in large insurance enterprise domainspecific language for combat simulation domainspecific language for salary calculation domainspecific language for billing a domainspecific language is somewhere between a tiny programming language and a scripting language 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 generalpurpose languages in design and implementation domainspecific languages are languages or often declared syntaxes or grammars with very specific goals in design and implementation a domainspecific 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 for instance the command line utility grep has a regular expression syntax which matches patterns in lines of text the sed 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 domainspecific languages and scripting languages is somewhat blurred but domainspecific languages often lack lowlevel functions for filesystem access interprocess control and other functions that characterize fullfeatured programming languages scripting or otherwise many domainspecific languages do not compile to bytecode 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 raytracing domain specific language like pov compiles to graphics files a computer language like sql presents an interesting case it can be deemed a domainspecific language because it is specific to a specific domain in sqls 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 domainspecific 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 domainspecific languages expand over time to include fullfeatured programming tools which further complicates the question of whether a language is domainspecific or not a good example is the functional language xslt specifically designed for transforming one xml graph into another which has been extended since its inception to allow particularly in its 20 version for various forms of filesystem interaction string and date manipulation and data typing in modeldriven engineering many examples of domainspecific languages may be found like ocl a language for decorating models with assertions or qvt a domainspecific transformation language however languages like uml 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 domainspecific 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 domainspecific languages should be used by programmers who looking at their current workbench realize they need a better drill and find that a particular domainspecific language provides exactly that domainspecific language topics usage patterns there are several usage patterns for domainspecific languages processing with standalone tools invoked via direct user operation often on the command line or from a makefile eg grep for regular expression matching sed lex yacc the graphviz tool set etc domainspecific languages which are implemented using programming language macro systems and which are converted or expanded into a host general purpose language at compiletime or readtime embedded or internal domainspecific languages implemented as libraries which exploit the syntax of their host general purpose language or a subset thereof while adding domainspecific language elements data types routines methods macros etc eg embedded sql linq domainspecific languages which are called at runtime from programs written in general purpose languages like c or perl 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 for the domainspecific language is embedded into the host application eg format strings a regular expression engine domainspecific languages which are embedded into user applications eg 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 domainspecific languages can be used in more than one way dsl code embedded in a host language may have special syntax support such as regexes in sed awk perl or javascript or may be passed as strings design goals adopting a domainspecific language approach to software engineering involves both risks and opportunities the welldesigned domainspecific language manages to find the proper balance between these domainspecific languages have important design goals that contrast with those of generalpurpose languages domainspecific languages are less comprehensive domainspecific languages are much more expressive in their domain domainspecific languages should exhibit minimal redundancy idioms in programming idioms are methods imposed by programmers to handle common development tasks eg ensure data is saved before the window is closed edit code whenever commandline parameters change because they affect program behavior general purpose programming languages rarely support such idioms but domainspecific languages can describe them eg a script can automatically save data a domainspecific language can parameterize command line input examples examples of domainspecific languages include html logo for pencillike drawing verilog and vhdl hardware description languages matlab and gnu octave for matrix programming mathematica maple and maxima for symbolic mathematics specification and description language for reactive and distributed systems 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 gamemaker language the gml scripting language used by gamemaker studio is a domainspecific language targeted at novice programmers to easily be able to learn programming while the language serves as a blend of multiple languages including delphi c and basic there is a lack of structures data types and other features of a fullfledged programming language many of the builtin functions are sandboxed for the purpose of easy portability the language primarily serves to make it easy for anyone to pick up the language and develop a game unix shell scripts unix shell scripts give a good example of a domainspecific 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 describe 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 controlflow 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 grep ls sort or wc coldfusion markup language coldfusions associated scripting language is another example of a domainspecific language for datadriven 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 cfml 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 domainspecific 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 photoshopcompatible image processing filter plugins filtermeister runs as a photoshop plugin itself and it can load and execute scripts or compile and export them as independent plugins 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 plugins and adds a number of specific features only useful in this specific domain mediawiki templates the template feature of mediawiki is an embedded domainspecific 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 software engineering uses there has been much interest in domainspecific languages to improve the productivity and quality of software engineering domainspecific 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 is an example of this the toolkit is a suite of utilities including a specification editor to create a requirements specification a dependency graph browser to display variable dependencies a consistency checker to catch missing cases in wellformed formulas 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 is languageoriented programming an integrated software engineering methodology based mainly on creating optimizing and using domainspecific languages metacompilers further information metacompiler complementing languageoriented programming as well as all other forms of domainspecific languages are the class of compiler writing tools called metacompilers a metacompiler is not only useful for generating parsers and code generators for domainspecific languages but a metacompiler itself compiles a domainspecific metalanguage specifically designed for the domain of metaprogramming besides parsing domainspecific languages metacompilers are useful for generating a wide range of software engineering and analysis tools the metacompiler methodology is often found in program transformation systems metacompilers that played a significant role in both computer science and the computer industry include metaii unreal engine before version 4 and other games unreal and unreal tournament unveiled a language called unrealscript this allowed for rapid development of modifications compared to the competitor quake using the id tech 2 engine the id tech engine used standard c 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 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 modelling languages statistical modellers have developed domainspecific languages such as bugs jags and stan these languages provide a syntax for describing a bayesian model and generate a method for solving it using simulation generate model and services to multiple programming languages generate object handling and services based on a interface description language for a domainspecific 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 gherkin is a language designed to define test cases to check the behaviour of software without specifying how that behaviour is implemented it is meant to be read and used by nontechnical users using a natural language syntax and a lineoriented 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 nondevelopers other examples other prominent examples of domainspecific languages include emacs lisp game description language opengl shading language gradle advantages and disadvantages some of the advantages domainspecific languages allow solutions to be expressed in the idiom and at the level of abstraction of the problem domain the idea is that domain experts themselves may understand validate modify and often even develop domainspecific language programs however this is seldom the case domainspecific languages allow validation at the domain level as long as the language constructs are safe any sentence written with them can be considered safe domainspecific languages can help to shift the development of business information systems from traditional software developers to the typically larger group of domainexperts who despite having less technical expertise have deeper knowledge of the domain domainspecific languages are easier to learn given their limited scope some of the disadvantages cost of learning a new language vs its limited applicability cost of designing implementing and maintaining a domainspecific language as well as the tools required to develop with it ide finding setting and maintaining proper scope difficulty of balancing tradeoffs between domainspecificity and generalpurpose programming language constructs potential loss of processor efficiency compared with handcoded software proliferation of similar nonstandard domainspecific languages for example a dsl used within one insurance company versus a dsl used within another insurance company nontechnical 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 generalpurpose language low supply of experts in a particular dsl tends to raise labor costs harder to find code examples tools for designing domainspecific languages jetbrains mps is a tool for designing domainspecific languages it uses projectional editing which allows overcoming the limits of language parsers and building dsl editors such as ones with tables and diagrams it implements languageoriented programming mps combines an environment for language definition a language workbench and an integrated development environment ide for such languages xtext is an opensource software framework for developing programming languages and domainspecific languages dsls unlike standard parser generators xtext generates not only a parser but also a class model for the abstract syntax tree in addition it provides a fully featured customizable eclipsebased ide architecture description language domainspecific entertainment language language for specific purposes metalinguistic abstraction programming domain dunlavey building better applications a theory of efficient software development international thomson publishing isbn0442017405 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 domainspecific languages acm computing surveys 374316344 2005 doi10114511188901118892 diomidis spinellis notable design patterns for domain specific languages journal of systems and software 5619199 february 2001 doi101016s0164121200000893 terence parr the definitive antlr reference building domainspecific languages isbn9780978739256 james larus spending moores dividend issn00010782 communications of the acm volume 52 issue 5 may 2009 werner schuster june 15 2007 whats a ruby dsl and what isnt c4media retrieved 20090908 martin fowler domain specific languages isbn9780321712943 marco brambilla jordi cabot manuel wimmer model driven software engineering in practice foreword by richard soley omg chairman morgan claypool usa 2012 synthesis lectures on software engineering 1 182 pages isbn paperback 9781608458820 isbn9781608458837 httpwwwmdsebookcom minilanguages the art of unix programming by eric s raymond martin fowler on domainspecific languages and language workbenches also in a video presentation domainspecific languages an annotated bibliography one day compilers building a small domainspecific language using ocaml usenix association conference on domainspecific languages dsl 97 and 2nd conference on domainspecific languages dsl 99 internal domainspecific languages the complete guide to external domain specific languages jeqn example of internal domainspecific language for the modeling and simulation of extended queueing networks articles external dsls with eclipse technology building domainspecific languages over a language framework citeseerx1011504685 using acceleo with gmf generating presentations from a mindmap dsl modeler uml vs domainspecific languages sagar sen et al metamodel pruning citeseerx10111566008 vtetypes of programming languages actorbased array aspectoriented classbased concatenative concurrent dataflow declarative domainspecific dynamic esoteric eventdriven extensible functional imperative logic macro metaprogramming multiparadigm objectbased objectoriented pipeline procedural prototypebased reflective rulebased scripting stack based synchronous templating assembly compiled interpreted machine lowlevel highlevel very highlevel first generation second generation third generation fourth generation fifth generation nonenglishbased visual vtemajor fields of computer sciencenote this template roughly follows the 2012 acm computing classification systemhardware printed circuit board peripheral integrated circuit very large scale integration systems on chip socs energy consumption green computing electronic design automation hardware acceleration computer systemsorganization computer architecture embedded system realtime computing dependability networks network architecture network protocol network components network scheduler network performance evaluation network service software organization interpreter middleware virtual machine operating system software quality software notationsand tools programming paradigm programming language compiler domainspecific language modeling language software framework integrated development environment software configuration management software library software repository software development software development process requirements analysis software design software construction software deployment software maintenance programming team opensource model theory of computation model of computation formal language automata theory computational complexity theory logic semantics algorithms algorithm design analysis of algorithms algorithmic efficiency randomized algorithm computational geometry mathematicsof computing discrete mathematics probability statistics mathematical software information theory mathematical analysis numerical analysis informationsystems database management system information storage systems enterprise information system social information systems geographic information system decision support system process control system multimedia information system data mining digital library computing platform digital marketing world wide web information retrieval security cryptography formal methods security services intrusion detection system hardware security network security information security application security humancomputerinteraction interaction design social computing ubiquitous computing visualization accessibility concurrency concurrent computing parallel computing distributed computing multithreading multiprocessing artificialintelligence natural language processing knowledge representation and reasoning computer vision automated planning and scheduling search methodology control method philosophy of artificial intelligence distributed artificial intelligence machine learning supervised learning unsupervised learning reinforcement learning multitask learning crossvalidation graphics animation rendering image manipulation graphics processing unit mixed reality virtual reality image compression solid modeling appliedcomputing ecommerce enterprise software computational mathematics computational physics computational chemistry computational biology computational social science computational engineering computational healthcare digital art electronic publishing cyberwarfare electronic voting video games word processing operations research educational technology document management book category portal wikiproject commons authority control gnd 75852640 