Is anyone using ktor?


#1

If so, what do you think?

ktor is a server-side web framework by JetBrains.


#2

I am considering migrating to Ktor from RatPack. It looks good, but the main problem currently is lack of documentation.


#3

Are you not happy with RatPack?


#4

Ratpack is a very powerful tool. In order to get the most of it, one needs Groovy (I use Java version + FreeMarker templates). So now I have to options: either move some of my code to Groovy (which is not a problem) or to Kotlin (for this I need ktor). I have parts of the project both in Groovy and in Kotlin, so both languages are quite familiar.
Kotlin have a huge advantage in backward interop with Java even without static compilation (it is not always easy to call Groovy dynamic classes from Java). But on the other hand Groovy DSL is much more concise which is important for building templates.


#5

I used Ktor for one side project and for the most part was very happy with it. It works as advertised, the coroutine support makes for a huge difference in reading and writing code.

The lack of documentation can be addressed by using the sample projects that basically demonstrate every feature there is in Ktor.

The best feature not to be overlooked is hot reload. Basically you can edit your templates in the debug mode and see the changes in the browser.

One general observation I had about web development in Kotlin is that HTML DSLs are not really usable on scale. Interestingly enough, Ktor samples prefer FreeMarker, which I ended up using too.