Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Domain-specific language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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 of 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: * life insurance policies (developed internally by a large insurance enterprise) * combat simulation * salary calculation * billing A domain-specific language is somewhere between a tiny programming language<!--here seems a generic tiny language is meant, see at a target--> 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 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]], 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 [[operating system shell|shell]] to perform more complex programming tasks. The line between domain-specific languages and [[scripting language]]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]], [[GIF]], [[JPEG]], etc., where [[Csound]] compiles to audio files, and a ray-tracing domain-specific language like [[POV-Ray|POV]] compiles to graphics files. === Data definition languages === A [[data definition 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. 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]], 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]], many examples of domain-specific languages may be found like [[Object Constraint Language|OCL]], a language for decorating models with assertions or [[QVT]], a domain-specific transformation language. However, languages like [[Unified Modeling Language|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.{{Clarify|reason=It's a bit funny comparison, isn't it?|date=July 2023}} 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.{{Citation needed|date=July 2023}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)