Chapter 4. Internal DSL implementation patterns
This chapter covers
- Embedded DSL patterns with metaprogramming
- Embedded DSL patterns with typed abstractions
- Generative DSL patterns with runtime metaprogramming
- Generative DSL patterns with compile-time metaprogramming
In part 1, you were inducted into the DSL-driven development paradigm. You saw DSLs in all their glory and the issues that you need to address to use DSLs in a real-world application. This chapter marks the beginning of the discussion about the implementation-level issues of DSLs.
Every architect has their own toolbox that contains tools for designing beautiful artifacts. In this chapter, you’ll build your own toolbox to hold architectural patterns that you can use to implement DSLs. Figure 4.1 depicts the broad topics that I plan to cover.