CraftSyntax.uk

Language / Domain knowledge / microarticle

What Is a Domain Specific Language?

The words of the work, with the expertise built in.

01 / Practitioner

Practitioners are people who do things.

02 / Domain

A domain is an area of knowledge or activity. Brewing beer. Making furniture. Directing aircraft. Writing comic scripts.

It contains things practitioners recognise, distinctions they care about, rules they follow and assumptions they rarely need to explain.

03 / Specific

Specific means adapted to, or distinctive within, that area of knowledge or activity. Its specialised vocabulary is sometimes called jargon.

“Panel” means something different to a comic artist, an electrician and a conference organiser. Context narrows the meaning. Shared expertise supplies the details.

04 / Language

A language expresses meaning through sounds, gestures, symbols, inscriptions and rules for combining them.

“Skinny caramel latte” is more than a list of ingredients. It describes an order. The customer doesn’t specify the equipment, every preparation step or the sequence of operations. The barista—a coffee practitioner—supplies that knowledge.

05 / Put them together

A system for expressing meaning, adapted to a particular area of knowledge or activity, using distinctions, conventions and rules understood by its practitioners.

Commonly called a DSL (Domain Specific Language), which is hysterical because only people with expertise in DSLs use the acronym “DSL”—itself a domain-specific term. Yay, Recursion: a definition or process that refers to, or applies, itself..

Practitioners already have working languages like this.

06 / XML Doesn’t Count

XML configuration files serve software. Their tags and nesting often make awful reading. They don’t speak the working language of practitioners.

They can encode human meaning, but the notation doesn’t supply the shared understanding of a craft. Calling a tag <character> doesn’t mean the software understands characters.

They aren’t what we’re discussing here. We’re interested in the language practitioners use to convey meaning to one another.

07 / You already do this

“What’s the ETA?” “Check the car’s MPG.” “Is that price including VAT?”

Three-letter abbreviations, used without unpacking them every time. Travel, motoring and shopping supply the context.

An abbreviation alone isn’t a whole language. It demonstrates the same habit: compress the expression because the people involved already understand the meaning.

The words are short because the knowledge behind them is large.

08 / The languages are already there

Some working languages are tightly standardised. Others depend on local practice and shared understanding.

DomainA few wordsWhat the context supplies
Coffee shops“Skinny caramel latte.”A drink, milk preference, flavouring and an understood preparation process.
Breweries“Dry-hop with Citra.”A brewing operation and hop variety; the recipe supplies quantities and timing.
Carpentry“Through mortise and tenon.”A joint, its geometry and a body of knowledge about making it.
Oil drilling“Increase weight on bit.”A drilling parameter, equipment behaviour and operating constraints.
Advertising“Thirty-second spot. End on the pack shot.”Duration, format and the intended closing image.
Air traffic control“Hold short of runway two-seven.”An operational instruction within standardised phraseology and procedures.
Role-playing games“Ninth-level fighter with Cleave.”A character specification whose details depend on the game and edition.
Comic scripting“Panel three. Close-up. Lara, silent.”A numbered image, framing, a known character and the absence of dialogue.
Typesetting“Ten-point type on twelve-point leading.”Type size, baseline spacing and an established craft vocabulary.