Book

Domain-Specific Languages

📖 Overview

Domain-Specific Languages examines how to create focused programming languages that solve problems within specific domains. The book provides patterns and techniques for DSL implementation across internal and external languages. Fowler presents concrete examples of DSL development through multiple case studies and reference implementations. The text covers both the technical aspects of language creation and the collaborative process of working with domain experts. The book details practical approaches to parsing, semantic models, symbol tables, and code generation. It explores the tradeoffs between different implementation strategies and provides guidance on when to use each approach. This work serves as both a technical manual and a broader meditation on how specialized languages can bridge the gap between software development and business domains. The patterns presented reflect fundamental principles about abstraction and language design that extend beyond DSL creation.

👀 Reviews

Readers value the book's practical examples and clear explanations of DSL concepts. The deep coverage of internal vs external DSLs and implementation patterns receives frequent mentions in reviews. Liked: - Concrete code examples in multiple languages - Clear distinction between internal/external DSLs - Focus on real-world business applications - Quality of technical diagrams - Balanced coverage of both design and implementation Disliked: - Heavy Java focus limits broader applicability - Some examples feel dated or overcomplicated - Later chapters become repetitive - Limited coverage of parser theory - Price point considered high for content depth One reader noted: "The workbench patterns chapter alone justified the purchase." Another commented: "Too Java-centric - Ruby and Groovy examples would have strengthened it." Ratings: Goodreads: 3.9/5 (369 ratings) Amazon: 4.1/5 (44 reviews) Safari Books Online: 4/5 (127 reviews)

📚 Similar books

Language Implementation Patterns by Terence Parr This guide focuses on implementing compilers and domain-specific languages through practical patterns and techniques.

Implementing Domain-Driven Design by Vaughn Vernon The book presents techniques for translating domain models into code implementations through domain-specific languages and patterns.

DSLs in Action by Debasish Ghosh This work covers the creation of internal DSLs in multiple programming languages with examples from finance and business domains.

Programming Language Pragmatics by Michael L. Scott The text explains language design principles and implementation techniques that form the foundation for creating domain-specific languages.

Code Generation in Action by Jack Herrington This book demonstrates how to build code generators and DSLs for automating repetitive programming tasks and creating specialized languages.

🤔 Interesting facts

🔹 The book took over three years to write, with Martin Fowler documenting his progress and insights on his blog throughout the development process. 🔹 While most programming language books focus on general-purpose languages, this book explores how custom languages can be created for specific business domains, making complex problems easier to solve. 🔹 Martin Fowler collaborated with Rebecca Parsons, the Chief Technology Officer of ThoughtWorks, to bring deep technical expertise to the book's internal DSL patterns. 🔹 The book's approach to DSLs was influenced by Fowler's extensive work with financial trading systems, where domain-specific languages are commonly used to express complex trading rules. 🔹 The concepts in the book have influenced modern tools and frameworks, including Ruby on Rails' approach to configuration and Gradle's build automation system.