News for hackers. Stuff that matters.
Re:Apple is rewriting Foundation in Swift by blululu on Sunday May 21, 2023 @11:53PM (#36027257)
Totally valid point that swift is only useful for developing for Apple products, but this same criticism also applies more or less to Kotlin on Android. If you are dealing with iOS it is a joy compared to objective C. I would also add that it is a really nice language in general that is modern, expressive and general ergonomic.
Re:Apple is rewriting Foundation in Swift by chii on Monday May 22, 2023 @12:03AM (#36027329)
> this same criticism also applies more or less to Kotlin on Android.

i think kotlin has more use outside compared to swift.

But a language has to start somewhere, so i wouldn't hold it against swift. It's a fairly well done language regardless, and nothing apple specific about it tbh (which are all just libraries).

Re:Apple is rewriting Foundation in Swift by Illniyar on Monday May 22, 2023 @12:37AM (#36027517)
Kotlin wasn't developed for Android. And can be run anywhere.

It was JetBrains pet project to fix archaic stuff in Java without making a Scala. It was designed from the get go for a wide base (as wide as java).

I'm not sure how it became Android's main target, but I doubt it was the original purpose.

Re:Apple is rewriting Foundation in Swift by jszymborski on Monday May 22, 2023 @12:44AM (#36027547)
Further to that point, Kotlin mainly targets the JVM (which can run pretty much everywhere), but also can be compiled to JavaScript, LLVM, and a bunch of other targets.

Honestly the only times I've evaluated Kotlin for personal projects was bc of that flexibility.

Re:Apple is rewriting Foundation in Swift by singularity2001 on Monday May 22, 2023 @01:01AM (#36027645)
recently kotlin can even be used to compile to native and wasm, but gradle makes it almost less usable than swift
Re:Apple is rewriting Foundation in Swift by pjmlp on Monday May 22, 2023 @02:03AM (#36027957)
With various levels of implementation quality, Kotlin/Native had to be rebooted, on JS it hardly offers anything better than TypeScript, on the JVM it is mostly used by Android shops anyway.
Re:Apple is rewriting Foundation in Swift by radley on Monday May 22, 2023 @12:48AM (#36027577)
I think everyone jumped from Java to Kotlin due to Oracle suing Google over Java in Android. It also provided a huge opportunity to be more deliberate since Android was maturing.
Re:Apple is rewriting Foundation in Swift by nazgulsenpai on Monday May 22, 2023 @02:13AM (#36028028)
Oracle sued Google over the Android's implementation of Java's API. Kotlin still uses those APIs as it is compiled to Java bytecode on Android.
Re:Apple is rewriting Foundation in Swift by pjmlp on Monday May 22, 2023 @06:08AM (#36029396)
That is an urban myth.

If that was the case, they would have adopted Dart instead of keeping an high dependency on the Java ecosystem for Android.

Android Studio, Gradle, Kotlin compiler, the libraries that Android depends on from Maven Central, all Java.

Re:Apple is rewriting Foundation in Swift by pjmlp on Monday May 22, 2023 @02:01AM (#36027944)
Because Google and JetBrains are in bed together in what concerns Android development tooling.

Try to use Kotlin without the Android ecosystem, it is just syntax sugar for the JVM.

Re:Apple is rewriting Foundation in Swift by philwelch on Monday May 22, 2023 @11:42AM (#36032885)
Java is just syntax sugar for the JVM too, it's just that Kotlin is a better one.
Re:Apple is rewriting Foundation in Swift by deaddodo on Monday May 22, 2023 @02:39AM (#36028189)
> Kotlin wasn't developed for Android. And can be run anywhere.

I agree and would go so far as to say that Dart is a better comparison to Swift than Kotlin is.

Re:Apple is rewriting Foundation in Swift by balder1991 on Monday May 22, 2023 @03:04AM (#36028306)
It was adopted on Android quite fast after Jetbrains made the integration in Android Studio almost flawless, partly because back then the Android runtime was stuck on the Java 6 syntax plus some syntax sugar that the IDE provided to mimic lambda functions.

It helped a lot that I think Jetbrains took advantage of all they could to make development in Kotlin very smooth, I remember back then people joked how Kotlin worked so flawlessly on Android Studio almost like it was the main language while on Xcode Swift was slow, the highlight would stop working constantly, refactoring was not supported, often indexing the project would hang forever etc.

Re:Apple is rewriting Foundation in Swift by philwelch on Sunday May 21, 2023 @11:56PM (#36027279)
I thought Kotlin was pretty widely used as a Java alternative on the backend
Re:Apple is rewriting Foundation in Swift by rahmeero on Monday May 22, 2023 @12:03AM (#36027330)
An example is smart contracts on the Corda blockchain, which is programmed in Kotlin. It may be me, but I have seen more Kotlin outside of Android than on it.
Re:Apple is rewriting Foundation in Swift by fnord77 on Monday May 22, 2023 @12:02AM (#36027323)
Kotlin seems kinds of pointless with the features in newer Java versions
Re:Apple is rewriting Foundation in Swift by doyouevensunbro on Monday May 22, 2023 @12:35AM (#36027508)
Just looking at Java’s upcoming string interpolation makes me so happy I moved to Kotlin years ago.

https://openjdk.org/jeps/430

Re:Apple is rewriting Foundation in Swift by d3nj4l on Monday May 22, 2023 @12:30AM (#36027477)
No amount of lipstick on the java pig will make it as ergonomic to use by default as kotlin.
Re:Apple is rewriting Foundation in Swift by scns on Monday May 22, 2023 @03:34AM (#36028454)
Harsh but have to agree.
Re:Apple is rewriting Foundation in Swift by pjmlp on Monday May 22, 2023 @06:09AM (#36029405)
It is enough that it is the Java Virtual Machine, not Kotlin Virtual Machine.

Hence why Kotlin only really matters on Android.

Re:Apple is rewriting Foundation in Swift by fbdab103 on Monday May 22, 2023 @01:08AM (#36027677)
Would Java had advanced without Kotlin on its doorstep?
Re:Apple is rewriting Foundation in Swift by pjmlp on Monday May 22, 2023 @06:10AM (#36029413)
Yes, because Kotlin hardly matters in regards to the JVM.
Re:Apple is rewriting Foundation in Swift by fnord77 on Monday May 22, 2023 @05:30PM (#36036974)
Lots of languages are converging on features and idioms. Scala and Haskell have had an influence on New Java too.
Re:Apple is rewriting Foundation in Swift by stevefan1999 on Monday May 22, 2023 @01:00AM (#36027642)
At least I got to integrate Spring Boot well with Kotlin. Same goes for writing Minecraft mods.