# Domain-Specific Language (DSL)

> A small language made for one job, like SQL for data or CSS for looks.

**Field:** Software Development  
**Category:** Languages  
**Also known as:** DSL, Domain Specific Language, Special-Purpose Language

## Think of it like

It is like the words only cooks use. They are great in a kitchen and no help in a garage.

## Definition

A domain-specific language is a small language made for one kind of job. SQL is for asking a database for data. CSS is for how a web page looks. A regular expression is for finding patterns in text. Each one says its job in very few words, but it cannot build a whole app on its own.

## Example

Jack uses three of them in one day. He uses SQL to pull orders and CSS to style a page. He uses a regex to check emails.

## Example code

```sql
SELECT name FROM customers WHERE city = 'London';
```

One line of SQL asks a whole question about data, and does nothing else.

## Why it matters

A good DSL turns a long program into one clear line. Most developers use several every day.

## Common mistake

Inventing a new DSL for a team that does not need one. Every new language is one more thing to learn, test and keep up.

## Three principles

- **One job.** Made for a single task.
- **Few words.** Short to say what you mean.
- **Not for everything.** Pair it with a full language.

## Related terms

- [Structured Query Language (SQL)](https://learn.benibix.com/term/development/sql)
- [Cascading Style Sheets (CSS)](https://learn.benibix.com/term/development/css)
- [Regular Expression (Regex)](https://learn.benibix.com/term/development/regular-expression)
- [Programming Language](https://learn.benibix.com/term/development/programming-language)
- [Markup Language](https://learn.benibix.com/term/development/markup-language)

## Taught in

- [Markup Languages and DSLs](https://learn.benibix.com/learn/development-languages/markup-languages-and-dsls): Programming Languages, 4/12

![A wide box labelled programming languages, split into two sides. On the left, general-purpose languages such as Python and Java, which can build almost anything. On the right, domain-specific languages, lit up, each made for one job: SQL for data, CSS for looks, regular expressions for text. Outside the big box sits a markup language, HTML, which describes a page but cannot calculate. Below, a strip of coloured blocks snapped together shows block-based programming.](https://learn.benibix.com/diagrams/dev4-language-kinds.svg)

---

Source: https://learn.benibix.com/term/development/domain-specific-language
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
