Can I use Kotlin in the Grail?

Some basic facts that lead me to this question:

  • Groovy has full Java compatibility
  • Kotlin has full Java compatibility
  • Kotlin also comes down to Java

Can I write Kotlin code in a Grails application?

I did a bit of work with Grails 2.x, and recently at my new job I worked with Kotlin, Spring and Struts. I really , as functions of N-security and Kotlin type of output, and Kotlin functional programming functions are much more natural and convenient to use than in Groovy (this last part is a pure opinion).

Can Grails be used to handle things like:

  • ORM
  • Matching requests to controllers / actions
  • JSP / GSP view parsing / rendering

but use Kotlin to write the actual logic of the domain classes, controller actions, services, objects, etc.

Probably unlikely, because I assume that some of the core Grails functionality is made possible by dynamic typing, but perhaps it is possible with either the Gradle plugin or the direct Grails plugin.

I like the sheer simplicity provided by the Grails configuration convention paradigm, but I prefer Kotlin's static typing and output type.

If I could write business logic in Kotlin in the Grails environment, then for me it would be the final structure of web applications!

+4
source share
1 answer

Grails?

. JVM- Grails. Kotlin Grails, , : https://github.com/jeffbrown/langdemo

+10

Source: https://habr.com/ru/post/1681409/


All Articles