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.

Figure 4.1. Roadmap of the chapter

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

4.6. Summary

4.7. References

sitemap