https://kotlinlang.org logo
Title
j

jdemeulenaere

12/19/2018, 9:54 PM
Has anyone experimented with serverless applications in Kotlin (e.g. with knative or AWS Lambda)? If so, with what "flavour" of Kotlin (JVM, JS, Native) ? And is the performance acceptable for the serverless world (especially for Kotlin JVM that has worse warm up time) ?
n

napperley

12/20/2018, 6:27 AM
Kotlin Native (currently in Beta) is one option. In fact there is a official Serverless Kotlin Native sample: https://github.com/JetBrains/kotlin-native/tree/master/samples/weather_function
c

cbruegg

12/20/2018, 8:12 AM
I wouldn't recommend the Java/JVM support of AWS Lambda. If you have some library dependencies, class loading can take many seconds. I learned this the hard way when I built an Alexa skill using Kotlin/JVM. One workaround is to use Graal to build a native executable: https://engineering.opsgenie.com/run-native-java-using-graalvm-in-aws-lambda-with-golang-ba86e27930bf
j

jdemeulenaere

12/20/2018, 9:41 AM
Unfortunately Kotlin Native and GraalVM are quite new and not really battle tested yet, right?
☝️ 1
c

cbruegg

12/20/2018, 9:55 AM
Yes, that's true.
☝️ 1
👍 1
u

uhe

12/20/2018, 1:07 PM
I also experienced the slow startup when we developed an Alexa skill with Kotlin/JVM. That said, you can of course employ strategies to keep your lambdas "warm" to avoid the long startup times.
n

napperley

12/21/2018, 10:07 PM
Kotlin Native and GraalVM are currently at the exploration ⛰️ phase 🙃.