Live data from Hacker News

Java is becoming more like Rust, and I am here for it

joshaustin.tech

1–10 of 71 posts

Re: Java is becoming more like Rust, and I am here for it

#3
The article is using immutable records and sum types as “more like Rust” and I am just sitting in the corner, wondering whether everyone has forgotten that these things came from FP in the first place. In my mind, a language isn’t “Rust-like” because it uses concepts we learned in FP.

We have languages like Haskell and, before it, ML. And I know ML didn’t invent it. We also have Scala, and for Scala, we don’t even have to leave the JVM. There’s also F#, which is a kind of cousin-of-a-cousin to Java.

Rust has sum types and immutability because tons of people thought these features were important, and lots of languages adopted them in parallel with the appearance of Rust.

Re: Java is becoming more like Rust, and I am here for it

#4
Isn't this more like "Java is becoming more like C#" ... again?

Record types, immutable after construction: https://www.c-sharpcorner.com/article/c-sharp-9-0-introducti...

Warning when a switch isn't exhaustive: https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...

Re: Java is becoming more like Rust, and I am here for it

#7
The examples are good but I am not really a fan of the title. It's not really Java becoming more Rust like, Rust didn't invent these concepts. I talked to dl about some of these concepts going into Java a decade ago because of Scala. In PL a lot of concepts have been around for a very long time. Java is becoming more type safe, or more functional would be better titles I think. But the comparison code between Rust and Java 21 is good.

Re: Java is becoming more like Rust, and I am here for it

#8
It's consistently been impressive to me how thoughtful the Java language is being steered. Especially the explicit choice to NOT have an async keyword where other languages were all falling over themselves to add it, with all the complexity it entails (and in Rust it's a pretty awkward fit).

Once projects Valhalla and Panama land Java will be transformed again. Exciting times.

Re: Java is becoming more like Rust, and I am here for it

#9
post #3

The article is using immutable records and sum types as “more like Rust” and I am just sitting in the corner, wondering whether everyone has forgotten that these things came from FP in the first place. In my mind, a language isn’t “Rust-like” because it uses concepts we learned in FP. We have languages like Haskell and, before it, ML. And I know ML didn’t invent it. We also have Scala, and for Scala, we don’t even ha…

> Disclaimer: In no way am I claiming that these Rust features caused their counterparts to appear in Java

> I would not be surprised if Kotlin and/or Scala were more influential in bringing this to life.

But yeah, I agree, generally weak article. I don't think it shows that "Java is becoming more like Rust" at all, because of the two listed features.

Post reply on HN