Software → Programming Languages
DSL
A domain-specific language designed to express solutions within a focused problem domain using specialized vocabulary and constraints.
DSL (Domain-Specific Language)
A domain-specific language is optimized for a particular problem domain rather than general software construction. Its vocabulary and rules encode domain concepts directly, which can make solutions shorter, safer, and easier for domain specialists to understand.
Examples include SQL for relational data queries, CSS for presentation rules, GraphQL for API queries, and configuration or policy languages created for specific platforms.
External and embedded DSLs
An external DSL has its own parser and syntax. An embedded DSL uses the syntax and runtime of a general-purpose programming language while exposing domain-oriented constructs.
Tradeoffs
DSLs improve expressiveness and validation inside their domain, but add tooling, interoperability, governance, and learning costs.