Remix.run Logo
hardwaregeek 5 days ago

Wouldn’t Kotlin be a more reasonable choice in that case? It has ADTs and a lot of the same niceties of Rust.

Artamus 5 days ago | parent | next [-]

I'm inclined to think that the Python -> Rust was only for some odds and ends. I know the biggest recipient of Rust trainings was the Android platform team at first, which I think also used a lot of C++.

Kotlin is definitely available at Google, but when talking about sym types et al it's not nearly as nice to use as Rust / OCaml.

sureglymop 4 days ago | parent | prev | next [-]

Yes. It can also be compiled to native. I just think it was held back too much by the java/jvm backwards compatibility but then again that's probably also the justification for its existence.

I definitely find it (and jetpack compose) make developing android apps a much better experience than it used to be.

What I like a lot about Kotlin are its well written documentation and the trailing lambdas feature. That is definitely directly OCaml inspired (though I also recently saw it in a newer language, the "use" feature in Gleam). But in Kotlin it looks nicer imo. Allows declarative code to look pretty much like json which makes it more beginner friendly than the use syntax.

But Kotlin doesn't really significantly stand out among Java, C#, Swift, Go, etc. And so it is kind of doomed to be a somewhat domain specific language imo.

DerArzt 4 days ago | parent | next [-]

I wouldn't say it's doomed. For projects in large organizations that have a large amount of java already, it provides better ergonomics while allowing interop with the existing company ecosystem.

4 days ago | parent | prev | next [-]
[deleted]
pjmlp 4 days ago | parent | prev | next [-]

Java is castrated on purpose on Android as means to sell Kotlin.

If that wasn't the case, Google would support Java latest with all features, alongside Kotlin, and let the best win.

See how much market update Kotlin has outside Android, when it isn't being pushed and needs to compete against Java vLatest on equal terms.

StopDisinfo910 4 days ago | parent [-]

Blame Oracle. If they had been more forward looking and a bit less greedy, Java vLatest would be the default language on Android.

pjmlp 4 days ago | parent [-]

Not at all, I stand by Oracle on their lawsuit.

Android is Google's J++, which Sun sued and won.

Kotlin is Google's C#.

Plus everyone keeps forgetting Kotlin is a JVM based language, Android Studio and Gradle are implemented in JVM languages, JVM are implemented in a mix of C, C++ and Java (zero Kotlin), Android still uses Java, only that Google only takes out of OpenJDK what they feel like, and currentl that is Java 17 LTS, most of the work on OpenJDK was done by Oracle employees.

StopDisinfo910 4 days ago | parent [-]

> Not at all, I stand by Oracle on their lawsuit.

I think it will be very hard for us to find anything in common to agree on then.

Anyway, it’s pretty clear Google is pushing Kotlin because they don’t want to have anything to do with Oracle which has not been cleared by the verdict of their last trial. The situation has nothing to do with anything technical.

Blaming them for pushing Kotlin when the alternative you offer is them using a language they have already been sued for their use of seems extremely misguided to me.

pjmlp 4 days ago | parent [-]

We don't have to agree in anything, I wasn't asking for any agreement to start with.

I call them dishonest by comparing outdated Java 7 subset with Kotlin, when back in 2017 the latest version was Java 9, and in 2025 it is Java 24, and yet the documentation keeps using Java 8 for most examples on Java versus Kotlin.

How come Google doesn't want to have anything with Oracle, when it is impossible to build an Android distribution without a JVM, again people like yourself keep forgeting OpenJDK is mostly a product from Oracle employees (about 80%) with remaing efforts distributed across Red-Hat(IBM), IBM, Azul, Microsoft and JetBrains (I wonder what those do on Android), Kotlin doesn't build for Android without a JVM implementation, Gradle requires a JVM implementation, Android Studio requires a JVM implementation, Maven Central has JVM libraries,....

If Google doesn't want anything to do with Oracle why aren't they using Dart, created by themselves, instead of a language that is fully dependent on Oracle's kigdom for its own very existence?

StopDisinfo910 4 days ago | parent [-]

> How come Google doesn't want to have anything with Oracle

They clearly don’t want to add anything which couldn’t be reasonably covered by the result of the previous trial.

The list you give was all already there then. Moving to a more recent version of Java wouldn’t be.

> OpenJDK is mostly a product from Oracle employees (about 80%)

Sun employees, not Oracle employees. Using Sun technology was fine, using Oracle technology is something else entirely.

pjmlp 4 days ago | parent [-]

I advise you to educate yourself who works and owns OpenJDK copyrights.

Can start here, https://dev.java/contribute/openjdk/

"Once you have contributed several changes (usually two) you can become an Author. An author has the right to create patches but cannot push them. To push a patch, you need a Sponsor. Gaining a sponsorship is usually achieved through the discussions you had on the mailing lists.

In order to become an Author, you also need to sign the Oracle Contribution Agreement (OCA)."

The go into https://openjdk.org/bylaws

"The OpenJDK Lead is an OpenJDK Member, appointed by Oracle, who directs the major efforts of the Community, which are new implementations of the Java SE Platform known as JDK Release Projects."

And this nice contribution overview from Java 22,

https://blogs.oracle.com/java/post/the-arrival-of-java-22

"Of the 26,447 JIRA issues marked as fixed in Java 11 through Java 22 at the time of their GA, 18,842 were completed by Oracle employees while 7,605 were contributed by individual developers and developers working for other organizations. Going through the issues and collating the organization data from assignees results in the following chart of organizations sponsoring the development of contributions in Java:"

To spare you the math, 77% were done by Oracle employees.

Now please show us how Kotlin compiles for Android without using Java.

Doesn't look like Google got rid of Oracle to me, more like they didn't even considered Dart, nor Go could stand a chance against the Java ecosystem among Android developers.

StopDisinfo910 4 days ago | parent [-]

You wrote than 80% of OpenJDK was written by Oracle employees. That’s patently untrue. Most of OpenJDK was written by Sun employees before Oracle bought Sun.

Your link doesn’t change any of that nor your clearly condescending comment before. You are perfectly aware of the fact by the way and you know exactly what I meant so I don’t really understand the game you are playing.

Oracle can claim Sun contribution as their own as much as they want. It doesn’t change the fact that you would have to be insane to touch anything they do now that it’s Oracle property.

pjmlp 4 days ago | parent [-]

What is pathetic is the quality of your answers, who do you think has written the code between Java 6 and Java 24?

I wonder what magic pixie dust has been writing Java code since 2013, those Sun employees have been working really hard on their ghost offices, surrounded by Oracle daemons, down in the dungeons.

I am playing the FACTS game.

StopDisinfo910 4 days ago | parent [-]

There is no facts game. I am in full agreement with you that Oracle maintains Java nowadays and writes most of the modern code in it. It remains originally a Sun product, a Sun initiative and most of the JVM historical code has been written by Sun. I have little interest in going to actually look in how many lines are from then and how many are new. It wouldn’t substantially change the nature of my argument anyway.

You are free to pretend that Oracle is a great steward of the Java ecosystem if you want or that they had a point in the trial they so brilliantly lost.

I’m free to say I vehemently disagree and perfectly understand why Google would rather stay far away.

I would rather prefer you didn’t insult me however but you do you.

vips7L 4 days ago | parent [-]

Oracle has been a fantastic steward of Java. I don’t think Java would exist or still be popular without them. Java is in its best state it’s been in decades.

brabel 4 days ago | parent | prev [-]

> ... the trailing lambdas feature. That is definitely directly OCaml inspired...

Kotlin has a very similar syntax to Groovy, which already had that feature (it looks identical in Groovy and Kotlin)... and I believe Groovy itself took that from Ruby, I believe (Groovy tried to add most convenient features from Python and Ruby). Perhaps that is what came from OCaml?? No idea, but I'd say the chance Kotlin copied Groovy is much higher as JB was using Java and Groovy before Kotlin existed.

actionfromafar 5 days ago | parent | prev | next [-]

Garbage collector in Kotlin makes it a no go for C or C++ displacement.

pjmlp 4 days ago | parent [-]

As someone that has left pure C++ applications in 2006, and has mostly written mixed language projects since 1999, usually the displacement is more religious than anything else.

In many use cases even if the performance is within the project delivery deadlines there will worthless discussions about performance benchmarks completly irrelevant to the task at hand.

And ironically many of the same folks are using Electron based apps for their workflows.

rendaw 4 days ago | parent | prev | next [-]

I think GP means "algebraic data types" not "abstract data types", probably specifically tagged unions. Both Kotlin and Java can (now) do something similar with sealed classes but it's quite less ergonomic.

michaelcampbell 4 days ago | parent | prev | next [-]

Kotlin never had the "shiny new" aspect to it that Rust did; everyone gave it a bit of side-eye for coming from a company that wrote the IDE to support it well.

swiftcoder 4 days ago | parent | prev [-]

Potentially, but Kotlin is even more recent that Rust, and didn't get blessed internally at Google till somewhat later