6 ms·
It seems to me that a lot of people seem to think prefering Kotlin signifies a move away from Java. But I simply don't understand how using a JVM language signi
by BossingAround 7y ago
It seems to me that a lot of people seem to think prefering Kotlin signifies a move away from Java. But I simply don't understand how using a JVM language signifies a move away from Java. After all, it all gets compiled into the same bytecode, and Kotlin heavily depends on the Java ecosystem.
If Oracle is 'poisoning Java', Kotlin's not the answer. Surely, it'd be a language totally independent of Oracle, wouldn't it?
- vitoreiji 7y agoI bet they have plans to make a different VM for Kotlin and move away from JVM, should be coming in the next couple of years.
- ForHackernews 7y agoWhy bother? Being on the JVM has many advantages and building some new VM (and compiler?) would be extra hassle and expense for not much gain.
- PunchTornado 7y agomoving away from oracle is `not much gain`?
- ForHackernews 7y agoThere's already at least two big-name alternatives to Oracle Java: The OpenJDK and Amazon's Corretto. If you're suggesting Google might make their own "supported" OpenJDK build, then sure, that might be worth something. That's different than moving away from JVM entirely to a different compiler target, as suggested by the parent comment.
- pjmlp 7y agoOpenJDK is like 90% developed by Oracle with smaller contributions from other partners in the Java community, including the JEPs that bring Java forward.
- liopleurodon 7y agoOracle v Google
- curt15 7y agoAndroid has been using OpenJDK for a while with no problems.
- nl 7y agoGoogle vs Oracle isn't "no problems" https://en.wikipedia.org/wiki/Oracle_America,_Inc._v._Google,_Inc https://en.wikipedia.org/wiki/Oracle_America,_Inc._v._Google....
- yorwba 7y agoAs far as I can tell, Oracle vs Google was due to Google not using OpenJDK, but their own implementation.
- dragandj 7y agoMoreover, their implementation didn’t work on standard compliand JVMs, and was called Java, despite being only similar to Java. Even Microsoft’s J++ worked on different JVMs if you didn’d use Windows specific classes...
- Leace 7y agoYes, especially that Kotlin already targets various architectures.
- untog 7y agoKotlin already has one in the form of Kotlin Native. So far no involvement from Google on that front, but things could change.
- JulianMorrison 7y agoKotlin already has a native compiler (targeting iOS and so forth).
- pjmlp 7y agoKotlin on Android ultimately runs on Google's ART, not a JVM implementation, think MS J++. Also JetBrains is betting on moving Kotlin beyond the JVM, to all platforms it can reach. The latest version of kotlinc is now built with Kotlin/Native.
- _Codemonkeyism 7y agoWhich one reason if I'd chose a JVM language I'd go with Kotlin and no longer Scala. The JetBrains people understand and care deeply about developers. Scala compilation of my current project takes ages with the newest Scala/SBT on an iMac Pro 16 core / 32 gb. I have a side project in Go, compilation, startup and execution is so fast that you don't think it's compiling at all. I wish language designers would use a fast language for the designer and not the 'see we can bootstrap our own language' approach. Kotlin/Native is at least a good compromise.
- mruts 7y agoHopefully dotty solves some of those problems. Compared to Scala, I personally find Kotlin inexpressive and ugly.
- pkolaczk 7y agoRecent 2.12 and 2.13 are plenty fast. Incremental compilation on the project I do takes about 1-3 seconds for me from hitting run to running the unit test after modifying the code. I get similar times in Kotlin.
- pkolaczk 7y agoThe performance difference between Scala compiler and Kotlin compiler is not as huge as advertised by Kotlin promoters: https://stackoverflow.com/questions/34615947/why-does-kotlin-compile-faster-than-scala https://stackoverflow.com/questions/34615947/why-does-kotlin... Also worth noting that that answer is quite old and Scala compiler got over 2x faster since that time and now has a much improved incremental compiler, so it may be on par with Kotlin, which added more features since that time and got slower. So both languages seem to be in the same league. There are many people complaining on Kotlin's performance as well: https://discuss.kotlinlang.org/t/kotlin-compile-so-slowly/1603 https://discuss.kotlinlang.org/t/kotlin-compile-so-slowly/16... Of course there are Scala idioms that can yield poor compile times, like code using implicits or macros a lot, but Kotlin doesn't even have these features, so instead you'd have to write lot of additional boilerplate code by hand. How can we call writing code by hand fast vs not writing code at all? That's comparing apples and oranges.
- sonnyblarney 7y ago"If Oracle is 'poisoning Java', Kotlin's not the answer." It's not Java, and at the same time it is. It's 'far enough away' to protect them legally, but close enough to leverage the ecosystem. Without that, it'd be very hard to attract new devs, Also, Android uses a kind of JVM, they've invested a lot. Oracle can only poison Java they'll have a harder time poisoning the JVM etc. - there's just too much dependent there. If Oracle goes nuclear with Java, Google has the wherewithal to fork their own version of the JVM. It the right move, pragmatically. Remember, Java is a very useful thing and especially the JVM.
- bad_user 7y ago> "If Oracle is 'poisoning Java', Kotlin's not the answer. Surely, it'd be a language totally independent of Oracle, wouldn't it?" No, the answer lies in companies that want to invest in OpenJDK, like Red Hat / IBM, to take away the stewardship of Java from Oracle and for us to move to distributions maintained by the community and not by Oracle. See: https://adoptopenjdk.net/ https://adoptopenjdk.net/ OpenJDK being GPLv2, the genie can't be put back in the bottle. This situation is precisely what Open Source is for: the ability to fork if you're not happy with the maintainers. Without that ability you're not talking about open source. Also languages like Kotlin and Scala are a step in the right direction, because it means that the ecosystem is not dependent on Oracle for language improvements. But yes, I agree with the sentiment. Kotlin isn't a breakup with Java, only a breakup with Oracle.
- jpz 7y agoType erasure on the JVM is still awful. Advocates and defenders have a variety of intellectual arguments to defend its awesomeness, but it doesn't "erase" its painfulness.