Chapter 10. Groovy as a static language

This chapter covers

  • Incorporating static typing in a dynamic language
  • Using the @TypeChecked annotation
  • Type inference and flow typing
  • Static compilation and the @CompileStatic annotation
  • Type checking extensions

We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.

T. S. Eliot

There are endless debates in computer programming. vi or emacs? Tabs or spaces? Interfaces or abstract classes? Likewise, the debate over the benefits of static versus dynamic languages is never ending. You’ll find people telling you that static languages are the best because you can find errors at compile time, while on the other side, ...

Get Groovy in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.