Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Towards fearless and seamless interop with Kotlin #130

Open
LifeIsStrange opened this issue Jul 7, 2020 · 0 comments
Open

Towards fearless and seamless interop with Kotlin #130

LifeIsStrange opened this issue Jul 7, 2020 · 0 comments

Comments

@LifeIsStrange
Copy link

Dotty promise to become the state of the art programming language on the JVM, feature-wise, while fighting clutter and cognitive overhead contrary to scala 2.x

But in the meantime that Dotty release, Kotlin is for most the best compromise. The issue is:
A (quickly) growing number of devs are going to Kotlin. They appreciate the language as it is elegantly designed and quite featureful. Once we, the devs, are on Kotlin, it becomes needlessly difficult to begin to use dotty.
Kotlin is often seen on the web as a "gateway drug" from java to scala. By having more mindshare, an arguably easier learning curve, a focus on minimal cognitive overhead, and by showing to us that new features can actually make us more expressive while making code simpler. By doing this, by showing to us (e.g java devs) the light, after that eventually want even more features and see what an even more rich language can be, this is the promise of dotty.
So once dotty release, a LOT of devs will be using Kotlin, and thanks to Kotlin will be really interested in learning dotty.
But in the real world, on production software, we don't do a full rewrite as they represent a massive economical and intellectual failure. So we want to incrementally rewrite parts of our Kotlin apps into dotty just like we rewrote them from java.

In order to allow us to benefit from dotty, the dotty developers will need to bring true interoperability with Kotlin, this is to me, (that and better java interop) the most important key factors regarding dotty success.

Regarding this fundamental goal, a roadmap should be drawn.
From https://discuss.kotlinlang.org/t/integrating-kotlin-into-java-scala-project/2554

Kotlin’s Java interop works due to the fact that Kotlin incorporates a parser for Java source code, which allows referencing declarations that haven’t been compiled yet. Kotlin doesn’t incorporate a Scala parser, so it can only invoke Scala code which has been compiled; the reverse is also true. Thus I don’t think that full three-way interop could be possible without a lot of extra work.

Dotty, to become truly relevant, will probably need to incorporate a parser for java and kotlin source code.

I hope that this issue will be prioritized, as otherwise scala 3 will never become truly mainstream and reach the audience its virtues deserve.

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

No branches or pull requests

1 participant