Skip to content

Add support for Kotlin actions #42

Open

Description

@markusthoemmes

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

Activity

  1. csantanapr commented on Apr 28, 2018

    @csantanapr
    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

  2. markusthoemmes commented on Apr 29, 2018

    @markusthoemmes
    ContributorAuthor

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

  3. mkouba commented on May 9, 2018

    @mkouba

    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.

  4. seabaylea commented on May 10, 2018

    @seabaylea

    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.

  5. mkouba commented on May 10, 2018

    @mkouba

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions