Live data from Hacker News

Swift is like Kotlin

nilhcem.com

261–270 of 364 posts

Re: Swift is like Kotlin

#261
post #225

Earlier quoted context omitted.

I assume Google will try to replace Java with Dart, because they have recently been focused on Flutter [1] [2] and Fuschia [2] development which are (mostly) C++ and DartLang stack. [1]: https://flutter.io/ [2]: https://github.com/flutter/ [3]: https://github.com/fuchsia-mirror

> I assume Google will try to replace Java with Dart I would have expected this, but not after pushing Kotlin. Kotlin is shiny enough to temporarily distract the typical developer from the daily struggles with the abysmal Android API. Kotlin and Java it will be for the next 10 years, for better or worse. Dart is not very popular within Google itself, and Fuchsia is nothing more than a paid hobby project[0]. [0] See h…

> Dart is not very popular within Google itself

I was under the impression that pretty much all the frontend work at google was compiled from Dart.

Re: Swift is like Kotlin

#262
post #3
post #2

0..<count is a lovely little piece of language design

What do you like about it? I was actually thinking the opposite... EDIT: Genuinely curious, this is not meant to troll or start a war. I like the more explicit feeling `count-1`. I'd use either...

0 ... count-1 fails when count is equal to the smallest value the type can represent (for example, if it's 0 and unsigned).

Re: Swift is like Kotlin

#263
post #3

Earlier quoted context omitted.

What do you like about it? I was actually thinking the opposite... EDIT: Genuinely curious, this is not meant to troll or start a war. I like the more explicit feeling `count-1`. I'd use either...

It confused me as well. "0.. is less than count"?

Add spaces for clarity:

  0 ..
I think Swift programmers should adopt this style.

Re: Swift is like Kotlin

#264
I find it very annoying that Google and Apple are creating new languages to solve similar problems and not worrying about cross platform. If you write for Apple you've been told to use Objective-C and Swift. If you're on Android it's Dart and now Kotlin. None of that stuff is used for Windows or Linux development or even mobile on the other OS.

I'm not a fan of proliferation of "platforms" but when it goes beyond libraries and into the language itself I consider that a very serious problem.

This is forcing developers to write apps twice, or use a 3rd party solution to run on both OSes. Yep, they're refusal to work together and create standards is allowing companies like Microsoft to have value by offering yet another solution that works on both phones.

Re: Swift is like Kotlin

#265
Kotlin would be unnecessary if Apple would do the work to interop/compile Swift both to the JVM ecosystem and the JavaScript one.

Unfortunately Apple's ambition on swift seems to have stalled.

Re: Swift is like Kotlin

#266
Kotlin would be unnecessary if Apple would do the work to interop/compile Swift both to the JVM ecosystem and the JavaScript one.

Unfortunately Apple's ambition on swift seems to have stalled.

Re: Swift is like Kotlin

#267
post #261
post #225

Earlier quoted context omitted.

> I assume Google will try to replace Java with Dart I would have expected this, but not after pushing Kotlin. Kotlin is shiny enough to temporarily distract the typical developer from the daily struggles with the abysmal Android API. Kotlin and Java it will be for the next 10 years, for better or worse. Dart is not very popular within Google itself, and Fuchsia is nothing more than a paid hobby project[0]. [0] See h…

> Dart is not very popular within Google itself I was under the impression that pretty much all the frontend work at google was compiled from Dart.

Only AdSense.

Re: Swift is like Kotlin

#268
Kotlin lacks the ability to do true functional programming that Swift has. Swift has pattern matching, recursive data structures (edit: specifically ADTs with enums or case classes is what I was thinking of here, should have written algebraic data types), tail call optimization, even some form of type classes, immutability (thanks @tmail21), and so on.

Kotlin does not have any of these (edit: this is now partly false, see below)

I'm sad that Google is supporting Kotlin and not Swift or Scala for Android, since at least with the latter two, you can use functional programming.

Edit: Actually, I'm looking into Kotlin again, and it looks like it's greatly expanded support for functional programming compared to a year or two ago. For example, algebraic data types can now be encoded in a similar manner to Scala, and kind of pseudo-pattern matched using `when`. TCO is now supported. There are lambdas, and support for closures. Destructuring assignment. But as far as I can see, still no immutable values (just immutable references), and no way to make extensible type classes, like in Scala and Swift.

I'm definitely going to take another look now. Last I checked a few years ago, Kotlin had very limited support for functional programming.

Re: Swift is like Kotlin

#269

I find it very annoying that Google and Apple are creating new languages to solve similar problems and not worrying about cross platform. If you write for Apple you've been told to use Objective-C and Swift. If you're on Android it's Dart and now Kotlin. None of that stuff is used for Windows or Linux development or even mobile on the other OS. I'm not a fan of proliferation of "platforms" but when it goes beyond lib…

Kotlin is looking at expanding it's targets beyond js/ts and java to be able to target native, and I think it's with iOS in mind...

Re: Swift is like Kotlin

#270

I find it very annoying that Google and Apple are creating new languages to solve similar problems and not worrying about cross platform. If you write for Apple you've been told to use Objective-C and Swift. If you're on Android it's Dart and now Kotlin. None of that stuff is used for Windows or Linux development or even mobile on the other OS. I'm not a fan of proliferation of "platforms" but when it goes beyond lib…

Imagine having just one programming language where there is likely one gatekeeper.

I doubt language innovation would happen with that setup.

Post reply on HN