Type checking your DSLs

Type checking your DSLs

Since Groovy 2.0, the Groovy language offers the ability to type check your code at compile time. Type checking is a nice feature for people who come from a strongly typed language world and do not feel comfortable with dynamic typing. On the other hand, Groovy is also a perfect match when it comes to writing DSLs. It becomes even more interesting if you know that you can combine strategies in order to provide the user with a statically checked DSLs.

In this session, we will introduce the type checking mechanism of Groovy and demonstrate some techniques that you can use to make your DSL compatible with the type checker. In particular, we will focus on the features that were introduced in Groovy 2.1 that make writing custom type checking much easier and show you how you can leverage that to help the compiler and introduce compile time errors for your scripts.

F929f5d80ef8a23b67ad8ac6f08416cd?s=128

Cédric Champeau

July 22, 2013
Tweet