Hacker News new | ask | show | jobs
by Benjammer 2254 days ago
Kotlin is taking over the JVM ecosystem like Scala could only have dreamed of doing. The JetBrains team took one of Scala's more glaring weaknesses, the tooling support, and made it the foundational strength of Kotlin. 100% inter-op with Java. It's a first class citizen alongside Java in IDEA for a long time, since before the language was even production ready. Supremely clean, coherent, and most of all concise documentation pages. They got support from Google surprisingly early on in the Android world. They have a really nice, web-based playground hosted on the main docs domain at play.kotlinlang.org. etc...

I think it's a good sign when you see it start to creep into random, seemingly disjointed areas, like how Kotlin DSLs are invading a lot of areas of dev-ops/infra-as-code. It speaks to the strengths of the language rather than the passion of the supporting community, imo.

Performance driven purists can continue to doubt, but I'm betting long by a mile on Kotlin, all it will take is time, more and more frameworks and ecosystems will integrate Kotlin, and rough edges can be polished.

>I would advice starting with some tests

The way that Kotlin extension functions and DSLs breathe fresh air into JUnit testing is hard to fully communicate. For me at least, it makes writing test code actually not suck anymore, and even fun in some cases.

3 comments

> They got support from Google surprisingly early on in the Android world.

You can thank the Oracle lawsuit for this.

Google has been preparing Kotlin as their escape hatch.

So they better get that Kotlin/Native ready, and rewrite all of Maven Central libraries being used in Android in Kotlin/Native.
Kotlin does not really take over JVM ecosystem, very few projects use Kotlin outside of Android world (which is not really JVM ecosystem). And even for Android, I believe, its promotion from Google was more to mock Oracle.
> And even for Android, I believe, its promotion from Google was more to mock Oracle.

It certainly helps them shift away from Java reliance, but have you ever actually coded an Android app? Android is stuck on Java 8 syntax, and Kotlin fixes that. It has a laundry list of QoL improvements over Java (delegation, type alias, extension functions, data classes, better string formatting, operator overloading, smart casting, to name a few) that make it so much more pleasing to use over Java. ESPECIALLY when coupled with the aging Android framework, which it enhances greatly.

That is how Google plays the game to sell Kotlin, by placing it against a half baked implementation of Java 8.

If Android had an up to date full implementation of Java, the sales pitch wouldn't work that well.

In fact, there are several people that mistakenly think Android Java is Java and then get positively surprised when they learn about the real deal.

Kotlin is awesome language, don't get me wrong. I used it for some of my backend projects. I just don't see it overtaking Java ecosystem, it's a wishful thinking. Developers don't care about QoL improvements that much, they just follow vendor standards.

Another aspect is that JVM evolves without taking Kotlin in consideration, so there's always danger of JVM introducing a feature that won't be available in Kotlin (and JVM has several interesting developments namely Loom, Valhalla). Like it or not, Kotlin is second-class citizen on JVM. It made sense in Java 7 era, when Java development seemed stuck and Java thought to be mostly done. Times changed, Java is evolving at much faster rates (I would even say, faster than Kotlin these days).

This is about JVM, of course on Android Kotlin is first-class citizen and everything's good for Kotlin there.

These are all Android problems. Not Java's.
Kotlin is meaningless in the JVM ecosystem, it is just yet another Groovy, Scala, Clojure and it will never get beyond single digit percentage.

In about 5 years it will be as meanigfull as former guest languages are today.

Without having any language support for what Java 25 will be capable of doing with value types, GPGPU, SIMD, Graal integration, as per JVM/Java roadmap, as it will be jailed by what Android is able to do.