Chapter 12. DSL implementation challenges

 

In this chapter

  • Scaling DSL implementations
  • Deploying DSL scripts in production
  • Treating code as data
  • Creating user-extensible languages

The first part of this book dealt with building a DSL from scratch, and the second part with testing, documenting, versioning, and presenting the DSL. Between the two, there are still some gaps—details that are important for creating successful DSLs that we couldn’t look at before you gained some experience building DSLs in Boo.

In this chapter, we’re going to look at some of the more interesting challenges for DSLs, and in the next chapter we’ll make use of many of the solutions outlined in this chapter to build a real-world DSL.

Note

Many of the topics in this chapter involve AST manipulation, which we covered in chapter 6. As a quick reminder, the abstract syntax tree (AST) is how the compiler represents the code text internally. Boo allows you to access and modify the AST, and these modifications will affect the generated code, producing the result that you want.

12.1. Scaling DSL usage

12.2. Deployment—strategies for editing DSL scripts in production

12.3. Ensuring system transparency

12.4. Changing runtime behavior based on AST information

12.5. Data mining your scripts

12.6. Creating DSLs that span multiple files

12.7. Creating DSLs that span multiple languages

12.8. Creating user-extensible languages

12.9. Summary