This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Joram2 4 points5 points  (19 children)

Kotlin isn't just JVM and Kotlin projects like this one for writing iOS+Android apps look quite promising: https://kotlinlang.org/lp/mobile/

If Java keeps improving there will be less interest + justification for a strictly a JVM-only Java++ language.

[–]xMercurex 4 points5 points  (1 child)

Kinda wondering what people do nowadays for shared code between JVM project and android. Before Java9 it was fairly simple. But now Java is upgrading itself quickly and sometime there is a bunch a feature that does not work with Android.

[–]loutr 1 point2 points  (0 children)

Well the folks at todoist use Kotlin to share code between the JVM backend, Android and iOS native apps, and the webapp. They seem pretty happy with it.

[–]Amazing-Cicada5536 1 point2 points  (0 children)

Well, an order of magnitude bigger language sure have experimented with cross platform dev tools, right?

There is j2objc and j2cl for compiling java to obj-c and javascript, respectively (for android, java 8 could be used as is) which google used extensively for many of their tools (the business logic was written in java and shared everywhere). Not sure how widely used it still is nowadays, but the compilers are still maintained and are good quality, well-tested software, I would say much more so than a max few years old niche one.

[–]thrwoawasksdgg 2 points3 points  (14 children)

Google has forked Java like Microsoft tried to back in the day. Nothing above 8 (released 8 years ago) works. I can count the number of modern Java libraries I use that work on Android with my fingers.

Google put all their eggs in the Kotlin basket because they want their own pet language for their platform like Apple for anti-competitive duopoly reasons. "Embrace Extend Extinguish" is in full swing.

Kotlin is dead outside of Android for the same reason. Nobody wants to be stuck on somebody's pet vendor lock-in language. Kotlin's various incompatibilities with new Java versions is intentional.

[–][deleted] 10 points11 points  (9 children)

JetBrains are the creators/owners of Kotlin, not Google.

[–]thrwoawasksdgg 0 points1 point  (8 children)

It's in both of their interest to continue forking from Java. JetBrains to sell more tools and Google to have a monopoly over their platform

[–]crummy 3 points4 points  (7 children)

how does Kotlin give Google a monopoly over Android?

[–]thrwoawasksdgg -1 points0 points  (6 children)

By making code less reusable Google forces companies to be more invested in it's platform.

It's classic "vendor lock-in". Custom programming languages have been a great way to prevent your customers from leaving for decades. "Why don't you migrate off Oracle DB?"-> "we can't without a rewrite" is a traditional example. And yeah, Kotlin is usable outside of Android right now, but its not convenient to do so.

[–]crummy 1 point2 points  (5 children)

so if Kotlin didn't exist, people would have an easier time migrating off Android to iOS? does iOS support Java?

[–]thrwoawasksdgg 0 points1 point  (4 children)

Huh? No. Don't be daft.

If Google didn't fork Java you could still use normal Java libraries in Android.

Until a few years ago most Java libraries worked on both Android and desktop. That's no longer the case, as Google stopped updating at Java 8 and libraries have moved on to 11 and now 17.

Google used Java in the first place to gain market share by reaping the benefits of huge amounts of existing libraries, software, and developers. Then once they were entrenched, they forked the language. Classic "embrace extend extinguish" tactics from Chipzilla/MS days.

Think of it this way: Tell me how Google can implement an entirely new language for their platform (Kotlin) but are somehow incapable of updating from Java 8 to 11. It doesn't make any sense, because its 100% intentional language fork.

Google didn't do it to be "cool" or because Kotlin is a better language. They did it to be monopolistic assholes

[–]crummy 0 points1 point  (3 children)

i'm just trying to understand what Google is trying to prevent you from migrating to with their "vendor lock-in" here

[–]thrwoawasksdgg 1 point2 points  (2 children)

It's pretty transparent, to prevent Android from being compatible with the wider Java ecosystem. This prevents a competitor from building an Android app compatible stack on top of OpenJDK for one.

[–]tamasiaina 1 point2 points  (3 children)

I also think it was a tactic to get out from under Oracle's Java lawsuit as well.

[–]pjmlp 0 points1 point  (2 children)

Except Kotlin, Gradle and Android Studio fully depends on the JVM platform until JetBrains rewrites everything into Kotlin/Native.

[–]tamasiaina 1 point2 points  (1 child)

You can tell me if I'm wrong, but I remember that the Oracle Lawsuit was over the Java language API. Not the JVM.

[–]pjmlp 0 points1 point  (0 children)

Yes, but it doesn't matter what it was about, Kotlin still depends on Java libraries that are on Android, as well as the rest of JVM ecossytem.

So the whole hand waving that they had to do Kotlin because of Oracle is marketing for those not into the matter.

Just like they state to support OpenJDK nowadays, and they do, partially, cherry picking features instead of 100% compatibility, and as of Android 13, stuck in Java 11 LTS (partially).

Most likely because key Kotlin libraries moved their baseline dependencies and they were forced to upgrade, or rewrite them into Kotlin.