1 What is a domain-specific language?
This chapter covers
- What a domain-specific language is
- What adopting a DSL-based approach does for an organization
- When to use a DSL
- What the key aspects of a DSL are
If you’re reading this book, you’ve probably already heard about domain-specific languages (DSLs). You might even have realized that you may need to use one. But do you really? And what is a DSL, and how would you build one?
Teaching about DSLs is tricky because it’s a very broad topic and is interconnected with other topics in both software development and computer science. This book will not try to teach you everything about DSLs or overwhelm you with myriad details. Instead, it will take you on a carefully planned route through a set of connected topics that cover all the basics and skills you’ll need to craft your own DSLs. This learning path will be example driven, quite literally going from the concrete to the abstract.
This book will also focus on business -oriented DSLs to empower domain experts, who are first and foremost business stakeholders and who generally don’t have backgrounds as software developers. The “user-friendly” part of this book’s title is meant to encompass qualities like “easy to understand and learn,” “practical,” etc. To that end, we’ll start by sketching out an example business case for which we’ll build a complete DSL throughout the course of this book.