"Covers a lot of ground...not only widely but deeply."
Your success—and sanity—are closer at hand when you work at a higher level of abstraction, allowing your attention to be on the business problem rather than the details of the programming platform. Domain Specific Languages—"little languages" implemented on top of conventional programming languages—give you a way to do this because they model the domain of your business problem.
DSLs in Action introduces the concepts you'll need to build high-quality domain-specific languages. It explores DSL implementation based on JVM languages like Java, Scala, Clojure, Ruby, and Groovy and contains fully explained code snippets that implement real-world DSL designs. For experienced developers, the book addresses the intricacies of DSL design without the pain of writing parsers by hand.
preface acknowledgments about the book
Part 1 Introducing domain-specific languages
1. Chapter 1 Learning to speak the language of the domain
1.1. The problem domain and the solution domain
1.2. Domain modeling: establishing a common vocabulary
1.3. Introducing DSLs
1.4. Execution model of a DSL
1.5. Classifying DSLs
1.6. When do you need a DSL?
1.7. DSLs and abstraction design
2. Chapter 2 The DSL in the wild
2.1. Building your first Java DSL
2.2. Making friendlier DSLs
2.3. DSL implementation patterns
2.4. Choosing DSL implementations
3. Chapter 3 DSL-driven application development
3.1. Exploring DSL integration
3.2. Internal DSL integration patterns
3.3. External DSL integration patterns
3.4. Handling errors and exceptions
3.5. Managing performance
Part 2 Implementing DSLs
4. Chapter 4 Internal DSL implementation patterns
4.1. Filling your DSL toolbox
4.2. Embedded DSLs: patterns in metaprogramming
4.3. Embedded DSLs: patterns with typed abstractions
4.4. Generative DSLs: boilerplates for runtime generation
4.5. Generative DSLs: macros for compile-time code generation
5. Chapter 5 Internal DSL design in Ruby, Groovy, and Clojure
5.1. Making DSLs concise with dynamic typing
5.2. A trade-processing DSL in Ruby
5.3. The order-processing DSL: the final frontier in Groovy
5.4. Thinking differently in Clojure
5.5. Recommendations to follow
6. Chapter 6 Internal DSL design in Scala
6.1. Why Scala?
6.2. Your first step toward a Scala DSL
6.3. Let’s DSL in Scala!
6.4. Building a DSL that creates trades
6.5. Modeling business rules with a DSL
6.6. Stitching ’em all together
6.7. Composing DSLs
6.8. Monadic structures in DSL
7. Chapter 7 External DSL implementation artifacts
7.1. Anatomy of an external DSL
7.2. The role of a parser in designing an external DSL
7.3. Classifying parsers
7.4. Tool-based DSL development with Xtext
8. Chapter 8 Designing external DSLs using Scala parser combinators
8.1. Parser combinators
8.2. The Scala parser combinator library
8.3. DSL design with parser combinators: step-by-step
8.4. A DSL that needs a packrat parser
Part 3 Future trends in Dsl development
9. Chapter 9 DSL design: looking forward
9.1. Growing language support for DSL design
9.2. DSL workbenches
9.3. More tool support
9.4. The mature evolution of a DSL
© 2014 Manning Publications Co.
- Tested, real-world examples
- How to find the right level of abstraction
- Using language features to build internal DSLs
- Designing parser/combinator-based little languages
About the reader
This book is written for developers working with JVM languages. Others will find techniques that (generally) work for them too.
"Thorough, well thought-out, carefully crafted."
"Covers the what, why, when, and how of DSLs."
"Exhaustive, competent, and compelling."
"Five languages, no trivial examples, all in one book."