kotless icon indicating copy to clipboard operation
kotless copied to clipboard

Custom runtimes with Kotlin/Native

Open DimitarNestorov opened this issue 5 years ago • 7 comments

While Ktor doesn't support Kotlin/Native yet maybe the Kotless DSL can be ported. I do believe it will reduce cold boot times and costs, maybe even functions will run faster. Maybe I can give it a shot in my spare time but first I'd like to hear your thoughts. Are you interested in support for custom runtimes in Kotless? Would you consider merging such a pull request from the community? If so I would love to hear about the preferred approach to tackle this issue.

https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html ~~https://cloud.google.com/appengine/docs/flexible/custom-runtimes/about-custom-runtimes~~ This was a link for App Engine. No support from Cloud Functions yet. https://docs.microsoft.com/en-us/azure/azure-functions/functions-custom-handlers https://www.alibabacloud.com/help/doc-detail/132044.htm https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-runtimes#openwhisk_ref_docker

DimitarNestorov avatar Oct 23 '20 06:10 DimitarNestorov

Hey, kotless 0.1.7-beta-4 supports GraavVM Custom Runtime. Does it solve your problem?

I also want to note, the feature is being tested right now.

AlexanderPrendota avatar Oct 27 '20 07:10 AlexanderPrendota

But support Kotlin Native looks interesting from my side 🙂

AlexanderPrendota avatar Oct 27 '20 07:10 AlexanderPrendota

GraalVM is still a VM (or at least I hope so cause it's in its name). For optimal performance it will be best to ship nothing but a runtime by compiling to native.

DimitarNestorov avatar Oct 27 '20 07:10 DimitarNestorov

GraalVM is a VM only during compilation to native binary. The result product is a native binary :)

TanVD avatar Oct 27 '20 07:10 TanVD

I will try to pull out some measurements between a Kotlin/Native binary and a GraalVM binary then to see if it makes sense at the end of the day. :)

DimitarNestorov avatar Oct 27 '20 07:10 DimitarNestorov

Here's a reason not to use GraalVM. It is GPL licensed.

DimitarNestorov avatar Oct 27 '20 08:10 DimitarNestorov

Here's a reason not to use GraalVM. It is GPL licensed.

As far as I understand, code generated by GraalVM would not be GPL licensed. So, it should not be a problem.

TanVD avatar Oct 27 '20 10:10 TanVD