Live data from Hacker News

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

blog.madhukaraphatak.com

71–80 of 148 posts

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

#71
This has a lot more to do with refactoring the build system than anything else. The more the build system adheres to the Java Gradle plugin, the easier it is to use Scala or other JVM compatible languages. There is an open ticket for it, and supposedly Gradle 2.0 will make this possible.

https://code.google.com/p/android/issues/detail?id=56232

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

#73

I want Python for Android. Ideally, it would compile to Dalvik/ART or ARM. It would use something like PySonar to infer types or use annotations to be able to use native types when possible (for speed & correctness). When the type isn't given or can't be deduced, it would fallback to boxed objects (like Nuitka does, in the way the offically C-Python keeps its objects in memory). But that is not neccessary, all that i…

http://kivy.org/

Best you'll get, and quite good.

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

#74
Theres a different between "supports writing your own code in that language" and "the platform APIs are in a language".

In theory, it should be possible to write code on the Android platform using any JVM language. Groovy, Scala, Clojure, Kotlin, etc. There are hiccups to that right now but you can hack your way to it generally.

But Android's APIs are going to stay in Java. That is a lot different than Apple's move to Swift, where the platform itself is moving to the new language.

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

#76
post #24

It is not going to happen. Google IO 2014, Android development fireside: https://www.google.com/events/io/schedule/session/85311b0e-7... The answer to this request is "Java is the official Android development language".

If I asked a restaurant if they would serve something besides bowls of gruel I would at least expect some sympathy like "we wish we could, but..." Instead they were actually mocking the idea and seem to have no clue how bad Java is.

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

#77
post #63

Earlier quoted context omitted.

Groovy has supported compile-time safety since version 2.0 with the optional @CompileStatic annotation. It's one of the few languages where you can mix static and dynamic typing, even within the same class. With this annotation enabled, you get pretty close to pure Java performance but with 1/5 the lines of code in some case. For something like Android, running Groovy with CompileStatic enabled by default would make…

> It's one of the few languages where you can mix static and dynamic typing In theory, but in practise virtually everyone uses the dynamic typing only. Groovy's really only used with Grails and for testing Java classes. > Android, running Groovy with CompileStatic enabled by default would make a lot of sense Unlike other statically-typed languages, Groovy's CompileStatic code was written by only one person and having…

> but in practise virtually everyone uses the dynamic typing only.

Why ? is it a social thing? or a technical thing?

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

#78
post #20

Um, people have already been able to use Scala to make Android applications. Just about anything that doesn't require dynamically generated JVM bytecode can manage, difficult and error-prone as it is. If we're talking about official support, then I'd rather Java 8 instead. And beefing up ART even more.

To me, Scala just feels like a mess. Java 8 isn't as modern as I'd like, but just having lambda expressions and declarative syntax would boost the quality of life so much.

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

#79
post #68
post #49

Earlier quoted context omitted.

It unifies the type system, which gets one of the big headaches of Java out of the way. It has a generics system that makes a lot more sense (allowing covariant/contravariant types, rather than forcing use-site variance everywhere). Case classes are wonderful for making simple data classes easy to read (and write). Honestly Scala is all about solving the pain points with Java, so just look at anything that's been wri…

right, all nice to have things. Does it actually solve any real problems? Does it fix GC performance? Does it fix API issues? Does it remove the need for JNI bindings to native code? No?

Repetitive code is a real problem. Or do you think performance is the only thing that can ever qualify as a "real problem"?

Implicits make it much easier to deal with API issues.

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

#80
post #21

Earlier quoted context omitted.

It still doesnt change the fact that Scala, as a programming language, tries to incorporate too many concepts while still trying to be typesafe. This makes the language complex, and not an ideal candidate.

There's no substantiative argument in this comment. > Scala, as a programming language, tries to incorporate too many concepts Too many concepts? Says who? How many concepts is too many? You don't have to use them all, and you can pick them up fairly easily as you go along; that's exactly how I learned the language. > while still trying to be typesafe. Not sure why that's contentious. > This makes the language comple…

> Says who?

Says at least me and the OP, and probably others... I haven't put a ton of time into learning Scala and only occasionally interact with it, but in that capacity I'd definitely say I find it a bit intimidating and someone hard to read. Certainly there are many ways to write Scala, and a Java-like style is doable, but idiomatic Scala, as far as I've seen, encourages terseness and the use of opaque punctuation-laden operators that aren't immediately interpretable by people not familiar with the language.

Whether legibility from non-experts is important is absolutely a matter of opinion and personal taste (it's a clear source of disagreement between the Python and Ruby communities as well), but if you're someone who thinks it's an important property for languages that get widespread adoption to have (and I am), looking at Scala code as it seems to typically be written would give you (or at least gives me) pause. I can look at Swift without having ever written any and know roughly what it's doing. I can't with Scala. I don't think they fill the same niche, as the poster seems to be advocating that they could.

Post reply on HN