Status of Kotlin integration in Play Framework

In this long thread about Nicolas Martignole tweet we're trying to start a cooperation to create a web framework project in Kotlin. But, we ask ourselves which would be the best way to go, if start with a new framework built from skretch in Kotlin, or try to do a new Play module which allow to use Kotlin in Play.

So, we asked Jetbrains Kotlin team if some work has been started with Kotlin integration in Play, and if yes, how we can contribute to it,
or if instead we have to start a new work from fresh.

Guys, you’re doing a beautiful work! I’m Kenthusiast :slight_smile:

Andrea

Hi,

We haven’t started integrating with Play yet, so you’ll need to start from scratch.
Maybe you can take some inspiration from James’ work on http://kool.io

Thanks for your enthusiasm about Kotlin and we appreciate your will to contribute very much!

If you need any help from us, we’ll be happy to assist you.

Hi Andrey, and thank you for your response. We are now in the process of choose if continue developing a complete new framework, such I started to do in my draft kweb project, or otherwise make an extension to Play that allow to use Kotlin. Both way have its advantages and disadvantage (one of the advantages have could been the presence of some started work on your part...)

We have already been expired from excellent James kool.io, and we think to use its html5 builder template, paired with a Kotlin String templates based template, which will allow users to write templates using plain HTML.

Well, a first thing we get stuck on it’s that such templates need to be escaped. I saw that escape it’s possible using StringTemplate class, but  how we can create a StringTemplate instances  from an interpolated String, without reparsing the string itself to convert it to an Array<Any>? I’m missing something or it is still work in progress?

Its pending work I'm afraid. We need string templates to create an instance of StringTemplate rather than just automatically create a String without any kind of escaping.

Right now today you have to make a StringTemplate by hand :frowning:

Here in Italy, we say "calm is the virtue of the strong".

We’ll just wait for StringTemplate to be completed, and in the meanwhile, as a workaroud,
I think we could escape all http request params using kotlin.template.HtmlFormatter.