Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kotlin actions #42

Open
markusthoemmes opened this issue Apr 26, 2018 · 5 comments
Open

Add support for Kotlin actions #42

markusthoemmes opened this issue Apr 26, 2018 · 5 comments

Comments

@markusthoemmes
Copy link
Contributor

Long time ago I came up with instructions on how to run Kotlin on the java runtime in OpenWhisk. Maybe we should add that stuff here?

See: https://github.com/markusthoemmes/openwhisk-kotlin

@csantanapr
Copy link
Member

We already started work on Kotlin runtime, work under construction once is stable IBM will contribute to Apache OpenWhisk https://github.com/ibm-functions/runtime-kotlin

@markusthoemmes
Copy link
Contributor Author

Hmm, any reason why we'd build a specific Kotlin runtime vs. just using the Java one?

@mkouba
Copy link

mkouba commented May 9, 2018

I think the reason is that java actions don't need kotlin standard library and so to keep the java runtime and java action jar minimal a dedicated runtime (with kotlin-specific stuff bundled) is considered.

@seabaylea
Copy link

There's really two reasons for having a specific Kotlin runtime:

  1. Platform and dependencies
    As @mkouba says, it means that we can embed the Kotlin standard library into the runtime and remove the need to include it in the action. It also means that in the future we have the option to switch to kotlin-native in the future if it makes sense to.

  2. Programming model and customisations
    It makes it much easer to customise for Kotlin and adopt a more idiomatic programming model. For example, experimental Kotlin runtime does simple things like append the "Kt" to the class name for you. The experimental runtime also adds a data class based API so that you can avoid having to work with JSON directly. The next step would be to look more at how to implement a Kotlin idiomatic async API.

@mkouba
Copy link

mkouba commented May 10, 2018

The experimental runtime also adds a data class based API so that you can avoid having to work with JSON directly.

This is also possible in Java, using e.g. Gson. Of course, java does not data data classes and so it's much more verbose.

This should imho be definitely added to java runtime too.

Kotlin idiomatic async API

Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants