Preface
The Java virtual machine runs on everything from the largest mainframe to the smallest microchip and supports every conceivable application. But Java is a complex, and sometimes arcane, language to develop with. Groovy allows us to build targeted single-purpose mini languages, which can run directly on the JVM along with the regular Java code.
This book provides a comprehensive tutorial on designing and developing mini Groovy-based domain-specific languages (DSLs). It is a complete guide to the development of several mini DSLs with a lot of easy-to-understand examples. This book will help you gain all of the skills needed to develop your own Groovy-based DSLs.
Groovy for Domain-specific Languages, Second Edition, guides you from the basics through to the more complex metaprogramming features of Groovy. The focus is on how the Groovy language can be used to construct domain-specific mini languages.
Practical examples are used throughout to demystify these seemingly complex language features and to show how they can be used to create simple and elegant DSLs. The examples include a quick and simple Groovy DSL to interface with Twitter.
The book concludes with a chapter focusing on integrating a Groovy-based DSL in such a way as the scripts can be readily incorporated into your own Java applications. The overall goal of this book is to take developers through the skills and knowledge they need to start building effective Groovy-based DSLs to integrate into their own applications.