JetBrains / kotless

Kotlin Serverless Framework
Apache License 2.0
1.15k stars 57 forks source link

Custom runtimes with Kotlin/Native #68

Open DimitarNestorov opened 3 years ago

DimitarNestorov commented 3 years ago

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

AlexanderPrendota commented 3 years ago

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 commented 3 years ago

But support Kotlin Native looks interesting from my side 🙂

DimitarNestorov commented 3 years ago

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.

TanVD commented 3 years ago

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

DimitarNestorov commented 3 years ago

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 commented 3 years ago

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

TanVD commented 3 years ago

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.