Live data from Hacker News

Google, it's time – We want Scala for Android

blog.madhukaraphatak.com

31–40 of 148 posts

Re: Google, it's time – We want Scala for Android

#33
post #19

Please not scala! I prefer to have clojure for android. Scala is too complex, to ugly, and tries todo too much. Its also to heavy for android (it needs tons of libs to run).

Clojure would be too large a leap syntax-wise I think. Scala at the very least gives you both FP and OOP in the same language.

Re: Google, it's time – We want Scala for Android

#35
post #8
post #3

My bet is for golang.

Current design of Android makes any non-JVM language a rather illogical and problematic choice. Writing JNI bridges for everything and reboxing costs would be prohibitive.

So what? I think with the arrival of ART, it's also not an impossible task anymore, in terms of compatibility. They just need a separate team to rewrite all the existing API's in Go (and also catch-up with the new ones by the time they finish this project). How much would that take for a team of 20 developers? I imagine not that long.

In theory, they could make ART allow for both the Java code and the Go code to work on Android, no? So we could have Google push new app development to Go, while they deprecate Java over the next 5 years (after Go support is out).

But to get developers to write Go, they also need a significant market share of Android L/ART-enabled devices, like over 50 percent, which will take 2-3 years to arrive there anyway. They can use this time gap to port Android APIs to Go, and when ART is on 50-70 percent of the devices, announce that developers can now write Android apps in Go, too (for Android L+ only).

They could announce it at the release of Android N (the one after M). By then Go 2.0 will probably be out, too, so they can support 2.0 on Android from the beginning, especially if they plan Go 2.0 to have some pretty major incompatibilities with 1.x. In the meantime, the Go team could also work on some "made for Android" features for Go 2.0, to make Go more optimized for Android. By then, they'd probably only have to support ARMv8, too (preferable, I think). So they can target only 64-bit ARMv8 hardware with Go (from what I hear Go works better with 64-bit hardware anyway).

I think Google can do this. They just need to plan it out. Three years is probably a reasonable time period for this.

Re: Google, it's time – We want Scala for Android

#36

Why not Kotlin? It's more like a modernized Java. It's closer to what Android developers are used to and it already supports Android. It interoperates well with existing Java code in your Android app. Also, it has excellent IDE support, since JetBrains is behind it. http://kotlinlang.org/

It's less mature than Scala; it has a smaller developer base or library ecosystem, and it is missing many Scala features (higher-kinded types, implicits). Most of Kotlin's features are already present in Java 8; if you're going to go to the trouble of supporting two languages, it seems perverse to pick Java and Kotlin when they're so similar.

Re: Google, it's time – We want Scala for Android

#37
You can use Scala for Android right now, as people are pointing out. However, it feels like a "second-class citizen" because the Android JVM has been optimized for enterprisey, Java-style coding with fewer, longer-lived objects than functional programming usually demands.

At a guess, I'd say that with Java 8+ they'd have to fix that. Probably why they said "no comment" as pjmlp pointed out (https://news.ycombinator.com/item?id=8192614).

Re: Google, it's time – We want Scala for Android

#38
post #2

I agree that Google should add more languages to android. And while Scala is a great language, it's very complex - so it won't benefit many of the less skilled users. A better language would be something with the simplicity and power of python, but with good performance.Groovy could be one such language.

Groovy's founder has said that he wouldn't have bothered creating it if he'd known about Scala at the time. In Scala you can write almost the same code as Groovy, word for word - but you don't have to give up compile-time type safety for it.

(Of course you can do more complex things in Scala, taking advantage of the powerful type system. But you don't have to if you don't want to)

Re: Google, it's time – We want Scala for Android

#40
Swift doesn't have a GC from what I know it has automatic reference counting. It's not really the same thing.

It's on compile time and not at run time. It injects release/retain calls between acquiring ownership and relinquishing ownership.

I could be wrong but I don't think they added GC to Swift, as Objective-C (at least not on Mac OS) doesn't have it.

EDIT: They got rid of the GC on Mac OS as well. They use ARC there as well just like iOS.

Post reply on HN