News for hackers. Stuff that matters.
Re:Running Swift code on Android by AndrewKemendo on Wednesday October 14, 2015 @12:02PM (#10387371)
Practical research often starts as academic exercise.
Re:Running Swift code on Android by Alupis on Wednesday October 14, 2015 @12:05PM (#10387399)
True - but is there a compelling reason we'd want Swift running on Android? I mean, we can say we want it just because (and maybe that's just fine), but is there a stronger reason to want it given many frameworks for mobile apps already compile into more-or-less native apps for each device?
Re:Running Swift code on Android by BinaryIdiot on Wednesday October 14, 2015 @12:39PM (#10387643)
> but is there a compelling reason we'd want Swift running on Android?

Yes because it's a language of higher level than C++ that can theoretically run on all platforms. Now I don't know about you but I'd much rather write the core of my software in a language that can be used on all platforms. This way I can leverage the same business logic everywhere and just have different, dedicated logic for UIs.

I once tried to use C++ for this but the STL is supremely lacking in almost every way compared to the standard libraries that come with almost every other language. There just isn't much choice out there.

Re:Running Swift code on Android by Alupis on Wednesday October 14, 2015 @12:44PM (#10387684)
Doesn't Java (what Android is already written in) provide that same benefit? Surely it's easier to get a basic JVM running on the iOS?
Re:Running Swift code on Android by BinaryIdiot on Wednesday October 14, 2015 @12:59PM (#10387802)
> Surely it's easier to get a basic JVM running on the iOS?

Gah, I'm not sure how you'd do that and still be able to deploy an application to the iOS app store. I would imagine cross compiling Swift would be orders of magnitude easier.

Re:Running Swift code on Android by jsmith0295 on Wednesday October 14, 2015 @01:37PM (#10388061)
You already can (sort of): http://RoboVM.com It also works with other JVM languages such as Kotlin which is somewhat similar to Swift.
Re:Running Swift code on Android by BinaryIdiot on Wednesday October 14, 2015 @03:36PM (#10388874)
Oh I hadn't seen that one, that's actually pretty neat. Their pricing is...interesting though. Zero company support at all for the solo package which seems insane to me but other than that it's pretty cool. I wonder how well it works and how it supports third party Java libraries (if at all).
Re:Running Swift code on Android by pjmlp on Wednesday October 14, 2015 @01:42PM (#10388105)
Compile to native code?

Java isn't married with a JIT, there are quite a few commercial AOT compilers.

Even Oracle is finally planning to add one after Java 9.

Re:Running Swift code on Android by BinaryIdiot on Wednesday October 14, 2015 @03:38PM (#10388889)
Sure that's fair I was mostly commenting with porting the JVM versus bypassing it all together. I'd love to see more commercial support for compiling Java and other languages to native just so they can be more portable.
Re:Running Swift code on Android by melling on Wednesday October 14, 2015 @12:11PM (#10387459)
Isn't the compelling reason always write once, run everywhere? Pick your favorite language and wouldn't you want to use that on Android and iOS? Swift is fast becoming the standard for iOS development. So, if you want to support Android too, any effort you can reuse is a win.
Re:Running Swift code on Android by gorena on Wednesday October 14, 2015 @12:16PM (#10387491)
Not sure of the state of Scala on Android, but having a language that actually has real closures is appealing. To say nothing of ADTs, nullability, etc...
Re:Running Swift code on Android by jsmith0295 on Wednesday October 14, 2015 @01:41PM (#10388094)
From my understanding it isn't that great. But Kotlin works well and it's far better at those things than Java. Theres also Clojure but I don't know how well supported it is. Running both of those on iOS is also possible via RoboVM - no need to wait for a good Swift on Android solution.
Re:Running Swift code on Android by sandGorgon on Wednesday October 14, 2015 @01:56PM (#10388186)
are you using Kotlin personally ? I have heard a lot of good things about Kotlin (especially the fact that Kotlin code seamlessly works with existing java code). But not sure if I should wait till 1.0
Re:Running Swift code on Android by jsmith0295 on Wednesday October 14, 2015 @02:31PM (#10388436)
I haven't for any real projects, I've only played around with it. But it seems like there's a decent number of people using it today, so my guess would be that waiting isn't necessary. If I were working on a cross platform mobile/web app today, I'd probably choose Kotlin.