You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Liu Jiayu (Jira)" <ji...@apache.org> on 2022/04/07 01:23:00 UTC

[jira] [Commented] (THRIFT-5548) Kotlin code generator

    [ https://issues.apache.org/jira/browse/THRIFT-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17518532#comment-17518532 ] 

Liu Jiayu commented on THRIFT-5548:
-----------------------------------

[~jensg] thanks for the questions. So far the work (pull request) is still work in progress, I've put the pull request into draft mode and put (work in progress) in title to make it clearer, and remove once the pull request is ready. Test suites and ASF license headers will be added after the implementation code is ready.

The value of having a separate Kotlin code gen, even if it builds on existing Java libthrift, is that the generated code (front-end code) will be in native Kotlin and thus can benefit from idiomatic Kotlin features (e.g. data class, richer type system) and provide a more modern (currently Java 18 is out but for back compatibility reasons the Java code gen targets are Java 8) alternative without compromising the compatibility of existing Java code generation.

> Kotlin code generator
> ---------------------
>
>                 Key: THRIFT-5548
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5548
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Compiler
>            Reporter: Jiayu Liu
>            Assignee: Jiayu Liu
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It'll be useful to create a Kotlin specific code generator that will product Kotlin code which is based on the existing Java library.
> The motivation for a separate Kotlin generator is that:
>  * some of the language features in Kotlin can largely simplify generated code in terms of code size and method counts
>  * implementing a new Kotlin code gen is easier because it can leverage the existing Java library



--
This message was sent by Atlassian Jira
(v8.20.1#820001)