News for hackers. Stuff that matters.
Re:New language features since Java 8 to 17 by hocuspocus on Sunday October 24, 2021 @02:31PM (#28980660)
Scala is fine. People understood it's not really worth it as a "better Java". Companies that choose Scala in 2021 are using either big data frameworks (where Python bindings are the most common alternative to Scala, not Java), or functional ecosystems (Typelevel, Zio). Scala 3 has taken an interesting direction and to me it seems that Odersky wants to win Python developers over rather than Java shops using Spring.

New features in Java and the JVM (records, loom, valhalla, ...) are directly going to benefit Scala and make it even better.

On the contrary, Kotlin's essence has always been threatened by the fact it's nothing more than a better Java. I assume there's still a big demand for that on Android, but if you're running on a recent JVM, I would certainly consider Java over Kotlin.

Re:New language features since Java 8 to 17 by zorr on Sunday October 24, 2021 @03:25PM (#28981073)
Kotlin started out as a better Java but it's more than that now. With Kotlin multiplatform you can compile to JVM, Javascript and Native from the same repository.

Java has been catching up on language features but I'm not sure if I'm ready to switch back to Java for Spring projects yet. Mostly because of nullability, extension methods and coroutines in Kotlin.

Re:New language features since Java 8 to 17 by hocuspocus on Sunday October 24, 2021 @04:50PM (#28981775)
Targeting multiple platforms is orthogonal to the core language design goal, which has always been to be more like C# on the JVM, with 100% Java interop and no need for a big standard library.

I give you nullability, however extension methods without proper typeclasses is just syntactic sugar, and coroutines will be superseded by Loom.

Java hasn't only been catching up, it now supports pattern matching which Kotlin still lacks.

Re:New language features since Java 8 to 17 by kaba0 on Monday October 25, 2021 @03:15AM (#28985205)
Targeting all those platforms will result in Kotlin falling in-between all of them. It will not be truly close the the JVM primitives, or the native ones or both in the end and will suffer from platform-specific quirks.

Especially with the heavy, under-the-hood developments of the JVM, like Loom and Valhalla.

Re:New language features since Java 8 to 17 by tunesmith on Sunday October 24, 2021 @03:00PM (#28980891)
Which is a bummer for folks that loves the cleanliness and power of "basic Scala" (pure functions, immutability) without wanting to get into deep FP theory (typelevel, zio). That has been a really nice pocket to be in for teams that have the discipline to not get clever with it. Same with teams wanting to integrate with Akka on scala.
Re:New language features since Java 8 to 17 by Zababa on Sunday October 24, 2021 @03:13PM (#28980982)
I think between Scala 3 and the Li Hayoi ecosystem, there is a path to simplicity. But that usually means you lose part of the appeal of the language, since you can't use some parts of the ecosystem.
Re:New language features since Java 8 to 17 by hocuspocus on Sunday October 24, 2021 @03:15PM (#28980997)
Zio is pretty much what you want. No need to understand category theory, no over-reliance on implicit resolution, ...

That said you don't need to understand that much to use high-level libraries in the Typelevel ecosystem. And when I do need to reach for low-level constructs, I find nice that everything is built upon clean and composable abstractions.

You mention Akka, it's kind of its own beast. The inner workings go definitely way beyond "better Java", yet Lightbend needs to provide a surface API that plays nice with Java interop. It's not an ecosystem easy to navigate in my opinion.

Re:New language features since Java 8 to 17 by hota_mazi on Sunday October 24, 2021 @04:19PM (#28981482)
Interestingly, I have the exact opposite opinion.

Scala has been declining steadily for a decade now, and Scala 3 is going to precipitate this state of affairs by splitting the shrinking community even further.

Kotlin, on the other hand, has done nothing but grow for the past five years, no doubt helped by Google's formidable support for it. I just took a quick look at one of its Slack channels, "getting-started", and it has over 38,000 people on it. And that's just one channel among dozens more.

I don't think Java's latest additions are anywhere near threatening Kotlin's rise to dominance since Java is moving at a very slow pace, by design, while Kotlin supports some features and design directions that will never happen in Java.

Re:New language features since Java 8 to 17 by jmfldn on Sunday October 24, 2021 @04:39PM (#28981674)
It's not in decline imho, it has settled as middle ranking language in terms of popularity and is v popular in its niche. It depends where you are of course but in London it's used in loads of places from major corporations to startups. The market is hot.
Re:New language features since Java 8 to 17 by frant-hartm on Monday October 25, 2021 @12:41AM (#28984550)
I used to contract in London, I still occasionally get info about contracts from recruiters, Kotlin largely replaced Scala, compared to 5 years ago.
Re:New language features since Java 8 to 17 by jmfldn on Monday October 25, 2021 @08:04AM (#28986848)
Kotlin is growing for sure on the server side. Far from replacing it though.
Re:New language features since Java 8 to 17 by pjmlp on Sunday October 24, 2021 @04:57PM (#28981830)
Dominant outside Android? Keep dreaming, where is the KVM implementation by JetBrains?

Yeah right they had to reboot it.

Re:New language features since Java 8 to 17 by RhodesianHunter on Sunday October 24, 2021 @10:47PM (#28984028)
Kotlin is in frequent use on the backend in many places, including Amazon and Google.
Re:New language features since Java 8 to 17 by pjmlp on Monday October 25, 2021 @03:53AM (#28985405)
Just like any JVM guest language since Beanshell, and all lumped together are a tiny dot on JVM deployment world wide.

Google is Kotlin's godfather, naturally they are using it, just like Amazon with their own Android flavour.