Domain-specific language
A domain-specific language is a language or notation tailored to expressing concepts, operations, or solutions within a particular problem or application domain.
Building User-Friendly DSLs
A domain-specific language is a programming language designed for expressing concepts and operations within a particular application domain.
- How it is used
- Positions DSLs as precise, editable specifications through which domain experts define software behavior.
- How deep it goes
- Develops DSL implementation through structure, projectional editing, generation, constraints, types, and evolution; defers textual parsing and internal DSLs.
- Examples
- Uses car-rental pricing rules, record types, attributes, and a customer price-quote app as running artifacts.
- What you can do after
- Build it from scratch: implement a Domain IDE that lets experts author DSL content and generates a Runtime.
Read how Building User-Friendly DSLs explains domain-specific language →
Write Powerful Rust Macros
A domain-specific language is a language designed to express concepts and operations within a particular application domain.
- How it is used
- Uses macros to express domain operations more readably while hiding validation and implementation details.
- How deep it goes
- Works through a declarative account-transfer DSL and defers negative-account handling and full cloud-test implementation.
- Examples
- Demonstrates SQL, println!, format!, an Account exchange! macro, and declarative cloud infrastructure specifications.
- What you can do after
- Build it from scratch with declarative macro patterns that turn domain commands into Rust operations.
Read how Write Powerful Rust Macros explains domain-specific language →
Functional Design and Architecture: Examples in Haskell
A domain-specific language is a programming language designed for a particular application domain, including an embedded form hosted within another language.
- How it is used
- Uses DSLs as domain-focused interfaces for subsystem behavior and to decouple client scenarios from native calls.
- How deep it goes
- Develops domain scenarios into embedded languages, including algebraic data types, interpretation, organization, and free-monad sequencing.
- Examples
- Uses spacecraft temperature-monitoring scenarios and a sequential sandwich recipe to illustrate language design.
- What you can do after
- Builds embedded DSLs from domain operations and expresses sequential scenarios using a free monad.
Read how Functional Design and Architecture: Examples in Haskell explains domain-specific language →
Kotlin in Action, 2E
A domain-specific language is a language designed to express operations and configurations within a particular problem domain.
- How it is used
- Expresses domain operations and configuration as readable, statically typed Kotlin code.
- How deep it goes
- Defines DSLs, contrasts them with APIs, and explains grammar through nesting, chaining, and infix assertions.
- Examples
- Uses Ktor HTTP routes, Gradle dependencies, SQL, regular expressions, HTML builders, and Kotest matchers.
- What you can do after
- Build it from scratch by combining Kotlin syntax features into typed, structured APIs with domain-specific grammar.
Read how Kotlin in Action, 2E explains domain-specific language →
Learn Haskell by Example
A domain-specific language is a programming language specialized for a particular application domain or problem class.
- How it is used
- Builds a musician-facing notation for composing within a Haskell synthesizer program.
- How deep it goes
- Explains a worked embedded DSL through typed operators, fixity declarations, data structures, and interpretation.
- Examples
- Demonstrates music notes, sequencing, grouping, repetition operators, and a sample composed expression.
- What you can do after
- Build it from scratch as an embedded Haskell notation that constructs and interprets musical compositions.
Read how Learn Haskell by Example explains domain-specific language →
Quarkus in Action
A domain-specific language is a language designed to express operations within a particular problem domain.
- How it is used
- Uses Java-based DSLs to construct GraphQL requests and access Kubernetes or OpenShift APIs from Quarkus applications.
- How deep it goes
- Defines DSL usage and demonstrates representative calls, but defers detailed GraphQL and cloud-platform treatment.
- Examples
- Demonstrates a dynamic cars query and a filtered OpenShift pod listing.
- What you can do after
- Apply it via Quarkus clients to build GraphQL documents and query Kubernetes or OpenShift resources programmatically.
Read how Quarkus in Action explains domain-specific language →
Acing the CCNA Exam: Volume 2 Advanced Networking and Security
A domain-specific language is a computer language specialized for a particular application domain or purpose.
- How it is used
- Defines infrastructure for Terraform provisioning and management.
- How deep it goes
- Explains specialization, benefits, limitation, and declarative infrastructure use without detailing HCL syntax.
- Examples
- Uses HCL configuration, Terraform providers, and Puppet DSL as examples of specialized infrastructure languages.
- What you can do after
- Apply specialized languages through Terraform to define desired infrastructure states with less effort.
Tiny Python Projects: Learn coding and testing with puzzles and games
A domain-specific language is a language designed for expressing solutions within a particular problem domain.
- How it is used
- Uses regular expressions to describe text patterns while implementing vowel replacement.
- How deep it goes
- Defines DSLs through regular expressions and demonstrates character classes and substitution, without developing broader regex syntax.
- Examples
- Demonstrates '[aeiou]' and re.sub() to replace lowercase and uppercase vowels in sample text.
- What you can do after
- Apply it via Python's re module to describe character patterns and substitute matching text.
GPU Programming with Triton
A domain-specific language is a programming language designed for a particular class of problems.
- How it is used
- Places GPU-kernel development between framework-level optimization and CUDA complexity.
- How deep it goes
- Defines Triton’s Python-embedded DSL and compiler workflow, but does not detail general DSL design principles.
- Examples
- Demonstrates a Python function decorated with @triton.jit as a kernel-writing workflow.
- What you can do after
- Apply it via Triton’s @triton.jit workflow to write GPU kernels in Python and compile them at runtime.
Read how GPU Programming with Triton explains domain-specific language →
Test Driven: Practical TDD and Acceptance TDD for Java Developers
A domain-specific language is a language designed to express concepts and operations within a particular problem domain.
- How it is used
- Uses domain-specific language to express acceptance tests in terms stakeholders can discuss, especially when tests bypass the graphical UI.
- How deep it goes
- Explains scripting-language tradeoffs and stakeholder and design consequences, without specifying steps for constructing a language.
- Examples
- Names Systir as a Ruby example and describes stakeholder-readable tests that omit references to UI widgets.
- What you can do after
- Evaluate acceptance-test interfaces by balancing scripting flexibility, vocabulary limits, stakeholder readability, and exposure of domain logic.
Grokking Web Application Security
A domain-specific language is a programming language tailored to expressing tasks and concepts within a particular problem domain.
- How it is used
- Uses compact expressions to let web-application users express domain tasks while preventing those expressions from becoming code-execution paths.
- How deep it goes
- Explains DSL purpose, expression scope, embedded-language evaluation, and parsing-based safeguards, but stops short of complete sandbox implementation.
- Examples
- Uses Google search operators, spreadsheet formulas, embedded Lua expressions, and Python integration as concrete DSL examples.
- What you can do after
- Build secure web-application DSLs by embedding Lua or parsing expressions before evaluation instead of dynamically executing untrusted input.
Read how Grokking Web Application Security explains domain-specific language →
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
A language designed to express concepts and operations within a particular application or problem domain.
- How it is used
- Expresses infrastructure resources in YAML or JSON while supporting linting, formatting, and automated validation.
- How deep it goes
- Defines DSL abstraction and demonstrates configuration testing, but does not explain DSL implementation internals.
- Examples
- Uses Terraform-compatible JSON, pytest tests, Terraform plans, CloudFormation YAML, and formatting or linting commands.
- What you can do after
- Apply it via Terraform or CloudFormation, then validate, format, lint, and unit-test configurations before deployment.
Also covered in
- Investing for Programmers
- AI-Powered Developer: Build software with ChatGPT and Copilot
- Data-Oriented Programming in JavaIn early access (MEAP)
- Shipping Go: Develop, deliver, discuss, design, and go again
- Practices of the Python Pro
- Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
- The Well-Grounded Rubyist, Fourth Edition
- Type-Driven Development with Idris
- Kafka for Architects
- Tiny CSS Projects
- BDD in Action, Second Edition
- Microservices Patterns, Second EditionIn early access (MEAP)
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- regular expressionA regular expression is a formal pattern notation that describes sets of strings and specifies how text can be matched, searched, or transformed.
Related concepts
- internal DSLincludes · An internal DSL is a domain-specific language embedded in a host programming language and expressed using the host language’s syntax and features.
- Tritonincludes · Triton is a programming language and compiler for writing and compiling high-performance GPU kernels.
- CSSincludes · CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- Gherkinincludes · Gherkin is a structured, human-readable domain-specific language for expressing software behavior as features and scenarios with steps such as Given, When, and Then.
- HashiCorp Configuration Languageincludes · HashiCorp Configuration Language (HCL) is a human-readable declarative language for expressing structured configuration, including infrastructure and service definitions.
- Q#includes · Q# is Microsoft's domain-specific programming language for expressing quantum algorithms and operations.
Questions about domain-specific language
What is domain-specific language?
A domain-specific language is a language or notation tailored to expressing concepts, operations, or solutions within a particular problem or application domain.
Which Manning books explain domain-specific language?
Building User-Friendly DSLs, Write Powerful Rust Macros, Functional Design and Architecture: Examples in Haskell, Kotlin in Action, 2E, Learn Haskell by Example, Quarkus in Action, Acing the CCNA Exam: Volume 2 Advanced Networking and Security, Tiny Python Projects: Learn coding and testing with puzzles and games and 4 more.
What should I know before learning domain-specific language?
Manning books that teach domain-specific language usually introduce function, HTML, Python and regular expression first.
What kinds of domain-specific language are there?
Kinds of domain-specific language include internal DSL, Triton, CSS, Gherkin, HashiCorp Configuration Language and Q#.
What is domain-specific language also called?
Domain-specific language is also called DSL.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.











