Live data from Hacker News

Swift Ported to Android

github.com

91–100 of 153 posts

Re: Swift Ported to Android

#91
post #85

Earlier quoted context omitted.

That turned out not to be quite as true as they said it was... > While the WWDC app does in fact use Swift, it’s not as much as you might think. Out of 281 classes, only 6 are written in Swift. The Apple Store app is also using Swift for its watch app. That’s about all the production Swift I could find from Apple on iOS. Source: https://medium.com/@ryanolsonk/is-apple-using-swift-4a6c80f7...

They are using on more on the Mac. Parts of Mac OS X El Capitan are written in Swift.

Only the dock IIRC.

Re: Swift Ported to Android

#92
post #85

Earlier quoted context omitted.

That turned out not to be quite as true as they said it was... > While the WWDC app does in fact use Swift, it’s not as much as you might think. Out of 281 classes, only 6 are written in Swift. The Apple Store app is also using Swift for its watch app. That’s about all the production Swift I could find from Apple on iOS. Source: https://medium.com/@ryanolsonk/is-apple-using-swift-4a6c80f7...

They are using on more on the Mac. Parts of Mac OS X El Capitan are written in Swift.

Federighi said on Gruber's podcast that the Dock team completely rewrote Dock in Swift. However most of the other OS X teams are only testing the waters. A big part of it is lack of 32-bit support for Swift apps.

Re: Swift Ported to Android

#93
post #66
post #57

Surprised noone mentions Kotlin. It's quite Swift-like, backed by JetBrains (Android Studio is based on their IntelliJ Idea), and 1.0 has only just been released. It has full interoperability with Java. Given the above, I don't see much point in using Swift, unless it's one of these projects that are about proving a point (nothing wrong with that and often very interesting).

I love Kotlin, but being able to develop libraries in one language and use them in both Android and iOS is huge. I have been using J2Objc for this until now, and while it's a great tool, it forces me to use Java, which I don't love. I would prefer being able to use Kotlin on iOS, but using Swift for Android development is a great boon.

AFAIK there's nothing stopping you using Kotlin on iOS with RoboVM since it is a JVM language - https://robovm.com.

Re: Swift Ported to Android

#94
post #70
post #66

Earlier quoted context omitted.

I love Kotlin, but being able to develop libraries in one language and use them in both Android and iOS is huge. I have been using J2Objc for this until now, and while it's a great tool, it forces me to use Java, which I don't love. I would prefer being able to use Kotlin on iOS, but using Swift for Android development is a great boon.

Could you develop libraries that way, though? It would have to be absolutely pure Swift, not using any iOS libraries, like NSURL etc. etc. - surely incredibly limiting.

You could this for your own libraries, but I would strongly recommend against doing this for a public lib if you want traction (e.g. if you are making a bunch of SDKs for your APIs) - in this case you should publish your lib in the most popular language(s) for the platform(s) you are targeting.

Re: Swift Ported to Android

#95
post #70

Earlier quoted context omitted.

Could you develop libraries that way, though? It would have to be absolutely pure Swift, not using any iOS libraries, like NSURL etc. etc. - surely incredibly limiting.

Not true. Both Foundation and Core Foundation libraries will be eventually ported and open sourced.

This feels a little like wishful thinking. Remember YellowBox back when Apple originally bought NeXT?

YellowBox was going to be a cross-platform updated version of the OpenStep APIs. While I remember some alphas of it, it basically got nixed.

http://www.roughlydrafted.com/RD/RDM.Tech.Q1.07/4B800F78-0F7...

As much as I enjoy using Apple products, their history says that they would not directly support something like this.

Re: Swift Ported to Android

#96
post #27

Earlier quoted context omitted.

People focus far too much on different languages. The fact that Android and iOS have very different UI libraries is usually a much bigger problem. Xamarin's big selling point is a cross platform ui library.

Lowest common denominator. Terrible for UX for everything but the most basic UI designs, sorry. Each platform requires UI work to make it really fit the platform in question.

I think most people don't understand Xamarin. Up until pretty recently Xamarin had no cross platform UI components. That is although all logic was shared, views had to be written separately for the different platforms - just like React Native.

With Xamarin Forms this has changed - you can add a Xamarin Form component and this will work adapt itself across the different platforms. The key word there is adapt - it is not like an HTML page, a Xamarin form input will look different on Android and iOS by default.

So I think your point, while valid, does not apply in any way to Xamarin!

Re: Swift Ported to Android

#97

Earlier quoted context omitted.

Not true. Both Foundation and Core Foundation libraries will be eventually ported and open sourced.

This feels a little like wishful thinking. Remember YellowBox back when Apple originally bought NeXT? YellowBox was going to be a cross-platform updated version of the OpenStep APIs. While I remember some alphas of it, it basically got nixed. http://www.roughlydrafted.com/RD/RDM.Tech.Q1.07/4B800F78-0F7... As much as I enjoy using Apple products, their history says that they would not directly support something like t…

We are long long days since that.

https://github.com/apple/swift-corelibs-foundation https://github.com/apple/swift-corelibs-libdispatch

Works is well under way.

Re: Swift Ported to Android

#98
post #57

Surprised noone mentions Kotlin. It's quite Swift-like, backed by JetBrains (Android Studio is based on their IntelliJ Idea), and 1.0 has only just been released. It has full interoperability with Java. Given the above, I don't see much point in using Swift, unless it's one of these projects that are about proving a point (nothing wrong with that and often very interesting).

I do not understand people's fascination with SWIFT. It is a great language compared to the atrocity of Objective-C but then no where close to Java.

I think there are lot of iOS programmers in the wild for whom SWIFT is first language and hence the fascination.

Re: Swift Ported to Android

#99
post #57

Surprised noone mentions Kotlin. It's quite Swift-like, backed by JetBrains (Android Studio is based on their IntelliJ Idea), and 1.0 has only just been released. It has full interoperability with Java. Given the above, I don't see much point in using Swift, unless it's one of these projects that are about proving a point (nothing wrong with that and often very interesting).

Two points for using Swift on Android: 1) shared code between your ios, mac, and android apps. 2) you already know swift. That said, there is always a cost to using a non-standard language to develop for a platform. Things like having to translate documentation as you read it, friction between system libraries and your languages standard library, etc. I've not looked at Kotlin in detail, but I wonder how much that fr…

>friction between system libraries and your languages standard library

Well, that's the thing : Kotlin emits bytecode. It is entirely interoperable with Java. All the Java APIs of the platform are accessible in Kotlin.

Swift on the other end can only target the NDK, which limits it to a very specific niche on Android.

Re: Swift Ported to Android

#100
post #57

Surprised noone mentions Kotlin. It's quite Swift-like, backed by JetBrains (Android Studio is based on their IntelliJ Idea), and 1.0 has only just been released. It has full interoperability with Java. Given the above, I don't see much point in using Swift, unless it's one of these projects that are about proving a point (nothing wrong with that and often very interesting).

Swift is compiled. One can expect better performance. The target is probably iOS developers.

? Android apps are also compiled ahead of time right now (whether they are written in java or kotlin).
Post reply on HN