As Kotlin is the first preferred language for Android when can we see a re-write of this library in Kotlin. Taking advantage of the Kotlin syntax and DSL?
Dagger is not an Android-specific library so their choice of languages (which, to be clear, the announcement was not that they prefer you write Kotlin, it was that their documentation and samples and libraries will start being Kotlin-first) has little bearing on what this library does. Moreover, the whole point of how Kotlin is set up is such that libraries don't need to rewrite from one to the other. Finally, it's unclear what Kotlin syntax and DSL Dagger could benefit from as it operates at compile-time where only the shape of your APIs are exposed, not the bodies of functions where syntax and DSLs live. You would have to abandon annotation processing and write a compiler plugin which means the library would no longer work for Java consumers (which are the overwhelming majority of Dagger's users). Not to mention that third-party compiler plugins are unsupported and it will be at least a year or two before that changes.
This is unlikely to happen entirely, given how many users use Dagger from
within a java compiler. We can't simply precompile the kotlin and ship a
jar with it.
Once there is a documented Kotlin compiler plugin/annotation
processor/something interface, we can begin to consider how to support that
natively and to generate Kotlin
On Thu, May 30, 2019, 12:17 AM SAGAR SURI notifications@github.com wrote:
As Kotlin is the first preferred language for Android when can we see a
re-write of this library in Kotlin. Taking advantage of the Kotlin syntax
and DSL?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/dagger/issues/1516?email_source=notifications&email_token=AAGBRXIZ27VPUQLV3YGI2ZTPX5INJA5CNFSM4HQ4QOOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWUKNOQ,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGBRXLRMLWB3LELMM7L7PLPX5INJANCNFSM4HQ4QOOA
.
Thanks for the quick reply @JakeWharton and @ronshapiro
I understood your point. I guess we won't be seeing a first class support for Kotlin compiler plugin anytime soon. But would love to see Kotlin generated codes.
Most helpful comment
This is unlikely to happen entirely, given how many users use Dagger from
within a java compiler. We can't simply precompile the kotlin and ship a
jar with it.
Once there is a documented Kotlin compiler plugin/annotation
processor/something interface, we can begin to consider how to support that
natively and to generate Kotlin
On Thu, May 30, 2019, 12:17 AM SAGAR SURI notifications@github.com wrote: