https://kotlinlang.org logo
Title
s

spierce7

10/17/2021, 9:55 PM
What is the best kotlin server to use? I’m looking for good compile times, and good compatability / startup times for graalvm. I’ve been nervous to use some of the servers that rely on annotation processors due to compile times.
b

Big Chungus

10/17/2021, 9:56 PM
If you're after graalvm native image, micronout or quarkus are probably your best bets.
☝️ 3
s

spierce7

10/17/2021, 9:57 PM
do those use annotation processors?
I’ve stayed away in the past because they look like they do.
n

napperley

10/17/2021, 10:34 PM
I have heard cases of some Kotliners getting good results using Ktor with GraalVM. A major factor in getting good results is that Ktor isn't heavily reliant on Annotations 😁.
b

Big Chungus

10/17/2021, 11:02 PM
Annotation processors are way better than runtime annotation scanning. I'd take compile rime processing over runtime scanning any day
7
s

spierce7

10/18/2021, 1:29 AM
@Big Chungus Sure - I agree. But I’ll take no annotation processing and no runtime annotation scanning over either any day.
👍 2
In order to justify the long term cost of an annotation processor in large projects, it has to be providing you a benefit that otherwise wouldn’t be reasonably possible. A better api simply solves the need for an annotation processor in this case. Annotation processors aren’t good in Java, and are even worse with Kotlin. I’d be open to one using KSP instead of an annotation processor, but I doubt any of the server frameworks support KSP yet.
@napperley I had tried ktor originally and got great results, but since the ktor team didn’t support graalvm directly, it was too much work to maintain. Also the ktor team has lots of really stupid bugs that have bit me in their client, and so I don’t trust them very much. However graalvm released a testing gradle plugin that autogenerates the configuration for it, so maybe I’ll try it again using the netty base.
j

James Richardson

10/18/2021, 7:37 AM
Have you considered #http4k?
👍 1
h

hhariri

10/18/2021, 2:28 PM
@spierce7 Sorry to hear that. Do you have more context on the bugs you mention? We are trying very hard to address as many issues as we can, and we are also trying to expand the team. But there’s only so much we can do with the number of folks we are.
s

spierce7

10/18/2021, 3:15 PM
@hhariri This has happened a few times with ktor. I believe the most recent one was fixed in 1.6.0 - https://youtrack.jetbrains.com/issue/KTOR-2711 There was also a bug that seems to be fixed now where requests were immediately failing, when they shouldn’t. We haven’t had customers complain about that for a while. Narrowing down the cause for a lot of these things is especially challenging on Android, due to the known errors in translating bytecode. There have been several times where we see impossible exceptions in production due to this. It turns out a good number of them were solved when we updated our ktor version.
@James Richardson I had not. After considering it, and looking at some benchmarks, I’m going to use http4k. Thank you. There are a few boxes I need to check on still, like coroutine support, but given that it’s a Kotlin framework, I assume that would be exceptional.
👍 1
o

Oliver.O

10/18/2021, 9:30 PM
Having just looked into http4k, seems like they do not support coroutines (yet). Why would one want to go without fine-grained, structured concurrency these days?
s

spierce7

10/19/2021, 3:58 AM
@Oliver.O I just found the same thing. I’m extremely disappointed.
guess I’m going with ktor
GraalVM recently came out with a gradle plugin that allows easy generation of the graalvm configuration files based on your projects tests - https://github.com/graalvm/native-build-tools I guess I’ll rely on that. My initial testing of it was pretty good.
r

Robert MacLean

10/21/2021, 6:17 AM
I’m looking for good compile times... I’ve been nervous to use some of the servers that rely on annotation processors due to compile times.
From experience with the annotation stuff in Micronaut, never noticed compile time differences to Dropwizard