What is in Kotlin that is not in Groovy?

Kotlin has:

  • data classes
  • sealed classes
  • extension methods (which are easier to write and use)
  • non-nullable types
  • cleaner standard library, with classic names for FP constructs (like map instead of collect)
  • Kotlin is newer, it didn’t implement closures as a class groovy.lang.Closure, and because of that integrates better with java 8 than groovy does

groovy has:

  • AST transformations
  • @Delegate AST (which is way better than in kotlin)
  • categories
  • standard library has templating
  • standard library has ConfigSlurper and ConfigObject, which are nicer to use than java.util.properties
1 Like