O'Reilly logo

DSLs in Action by Debasish Ghosh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Internal DSL design in Ruby, Groovy, and Clojure

This chapter covers

  • Making DSLs concise using duck typing and metaprogramming
  • Implementing a trade-processing DSL in Ruby
  • Improving our order-processing DSL using Groovy
  • Thinking differently about the trade-processing DSL in Clojure
  • Common pitfalls with each language

The best way to learn new paradigms and design techniques is to look at real implementations using the best languages that support them. In chapter 4, you saw quite a few idioms and patterns that can help you develop expressive internal DSLs. For this chapter, I’ve selected three of today’s most popular languages on the JVM. You’re going to go through the exercise of building real-world DSLs using them.

Before going into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required