News for hackers. Stuff that matters.
Re:Kotlin is now Google’s preferred language for Android app... by BossingAround on Wednesday May 08, 2019 @03:44AM (#19856707)
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?

Re:Kotlin is now Google’s preferred language for Android app... by bad_user on Wednesday May 08, 2019 @06:57AM (#19857644)
> "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/

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.

Re:Kotlin is now Google’s preferred language for Android app... by vitoreiji on Wednesday May 08, 2019 @04:09AM (#19856823)
I 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.
Re:Kotlin is now Google’s preferred language for Android app... by untog on Wednesday May 08, 2019 @05:15AM (#19857153)
Kotlin already has one in the form of Kotlin Native. So far no involvement from Google on that front, but things could change.
Re:Kotlin is now Google’s preferred language for Android app... by JulianMorrison on Wednesday May 08, 2019 @05:18AM (#19857164)
Kotlin already has a native compiler (targeting iOS and so forth).
Re:Kotlin is now Google’s preferred language for Android app... by Leace on Wednesday May 08, 2019 @05:13AM (#19857144)
Yes, especially that Kotlin already targets various architectures.
Re:Kotlin is now Google’s preferred language for Android app... by ForHackernews on Wednesday May 08, 2019 @05:08AM (#19857111)
Why 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.
Re:Kotlin is now Google’s preferred language for Android app... by PunchTornado on Wednesday May 08, 2019 @05:22AM (#19857189)
moving away from oracle is `not much gain`?
Re:Kotlin is now Google’s preferred language for Android app... by ForHackernews on Wednesday May 08, 2019 @05:36AM (#19857265)
There'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.
Re:Kotlin is now Google’s preferred language for Android app... by pjmlp on Wednesday May 08, 2019 @04:51PM (#19862789)
OpenJDK is like 90% developed by Oracle with smaller contributions from other partners in the Java community, including the JEPs that bring Java forward.
Re:Kotlin is now Google’s preferred language for Android app... by liopleurodon on Wednesday May 08, 2019 @05:24AM (#19857196)
Oracle v Google
Re:Kotlin is now Google’s preferred language for Android app... by curt15 on Wednesday May 08, 2019 @05:58AM (#19857368)
Android has been using OpenJDK for a while with no problems.
Re:Kotlin is now Google’s preferred language for Android app... by nl on Wednesday May 08, 2019 @06:17AM (#19857461)
Re:Kotlin is now Google’s preferred language for Android app... by yorwba on Wednesday May 08, 2019 @06:23AM (#19857499)
As far as I can tell, Oracle vs Google was due to Google not using OpenJDK, but their own implementation.
Re:Kotlin is now Google’s preferred language for Android app... by dragandj on Wednesday May 08, 2019 @07:35AM (#19857845)
Moreover, 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...
Re:Kotlin is now Google’s preferred language for Android app... by jpz on Wednesday May 08, 2019 @09:07AM (#19858454)
Type 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.
Re:Kotlin is now Google’s preferred language for Android app... by pjmlp on Wednesday May 08, 2019 @05:50AM (#19857329)
Kotlin 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.

Re:Kotlin is now Google’s preferred language for Android app... by _Codemonkeyism on Wednesday May 08, 2019 @05:56AM (#19857361)
Which 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.

Re:Kotlin is now Google’s preferred language for Android app... by pkolaczk on Friday May 10, 2019 @11:22AM (#19878608)
The 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...

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/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.

Re:Kotlin is now Google’s preferred language for Android app... by mruts on Wednesday May 08, 2019 @06:59AM (#19857656)
Hopefully dotty solves some of those problems.

Compared to Scala, I personally find Kotlin inexpressive and ugly.

Re:Kotlin is now Google’s preferred language for Android app... by pkolaczk on Friday May 10, 2019 @11:24AM (#19878626)
Recent 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.
Re:Kotlin is now Google’s preferred language for Android app... by ptx on Wednesday May 08, 2019 @06:46AM (#19857600)
The Kotlin compiler still runs on the JVM. The native compiler is actually built with Excelsior JET, not with Kotlin/Native. (I think Nikolay Igotti, the Kotlin/Native lead, mentioned somewhere that the JVM is often faster for the kind of graph manipulation that the compiler does a lot of.)
Re:Kotlin is now Google’s preferred language for Android app... by pjmlp on Wednesday May 08, 2019 @08:10AM (#19858050)
Fair enough, although I imagine it is only a matter of Kotlin/Native maturity.
Re:Kotlin is now Google’s preferred language for Android app... by dredmorbius on Wednesday May 08, 2019 @06:30AM (#19857522)
ART?
Re:Kotlin is now Google’s preferred language for Android app... by pjmlp on Wednesday May 08, 2019 @06:32AM (#19857530)
Re:Kotlin is now Google’s preferred language for Android app... by dredmorbius on Wednesday May 08, 2019 @07:02AM (#19857665)
Thanks. Not easily findable.
Re:Kotlin is now Google’s preferred language for Android app... by sonnyblarney on Wednesday May 08, 2019 @06:06AM (#19857408)
"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.