Live data from Hacker News

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

blog.madhukaraphatak.com

61–70 of 148 posts

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

#61
post #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.

If Google can't resolve their differences with Oracle Kotlin could be a way forward. Especially given the Android Studio connection.

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

#62
post #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 th…

He also says that Swift is bringing lambdas to iOS, when Objective-C has had lambdas for years and years now.

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

#63
post #38

Earlier quoted context omitted.

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)

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 it be the default would expose all the bugs.

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

#64
1. Most of the threads like this are going to turn into I like this language so let's rewrite Android in that.

2. Even if Google changes the primary development languages of Android where do you go to ask developers to port their Java libraries, technical bloggers to update their blogs with Scala code or change thousands of questions on SO.

Documentation/Q&A created around Java/Android is equally important.

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

#65
The article reeks of ignorance. Swift doesn't really have GC (but ARC) - https://www.google.com/webhp?sourceid=chrome-instant&rlz=1C5.... It also takes an unnecessary dig at nodejs. Has the author ever written node.js production code? What bugs has the author found and filed?

I am sure most android devs rather have a major ramp up of the Android APIs rather than switching the programming language. The real problem with Android is the ungainly APIs and how very cumbersome it is to develop anything reasonable.

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

#66

If they're not even giving us Dart or Go for Android (their own languages), what is the probability they will give us official support for Scala? Yes, Scala runs on the JVM, and the former two don't. And yes, Go is not really designed as an end-user GUI application building language. But Dart has a nice VM of its own and is designed for client-side apps. I would like to see Dart on Android and the original author is…

Original author here

I don't mean disrespect when I say niche. I just mean in terms of community, Scala seems to more diversified as it gets used in variety of fields compared to Dart and Go. This is just view of mine.

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

#67
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.

Technically speaking, Android doesn't fully support Java 6. It's only a partial implementation of Java, since Java is overweight. The Android team has been adding requested features to the SDK in piecemeal form. With that said, you can already get Java 8 lambdas in Android using the retrolambda project. http://zserge.com/blog/android-lambda.html

How does this work with a jar which contains classes using java8 features? Will it work in this situation or is it only for classes to be compiled? Can retrolambda be applied in other situations to keep the java version at 6 but use java 8 features?

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

#68
post #49
post #15

according to apple, swift uses ARC, not GC. https://developer.apple.com/library/prerelease/mac/documenta... How does Scala solve any of the problems with Java?

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?

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

#69
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 is needed is a decent wrapper to the Android API for Python, and some packaging support. It is now already possible to compile Python for Android to include it in your app. What I'd like to be able to do is to write the whole thing in Python (+ a GUI design tool maybe).

I already see some people saying, that's not possible, because an interpreted language uses too much resources (CPU, memory, esp. battery) for mobile. Well, 90% of the apps I use are not computationally expensive. The consume battery mainly via network access, and via the screen, both of which is independent of the language or runtime used. And when they are doing something computationally intensive, it is usually the layout and drawing of the GUI - most of which is done by the native framework anyway. Most apps are literally just fancy listboxes and details pages, with a database and a web backend. (The great exception are games, of course.) For these apps, a rapid development language like Python (or Javascript, or heck, a new VB) would be great, ideally augmented by good tooling. And if you have something CPU intensive (map routing, image processing, complex translation etc.), you'll just write it in a C library anyway.

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

#70
post #60
post #56

No. Google its time, we want Go for Android.

It's being talked about https://docs.google.com/document/d/1N3XyVkAP8nmWjASz8L_Ojjnj...

Yes, however there is a major caveat: "Providing a Go equivalent to the Android platform is intractable."

What is actually happening: "There is however, a subset of Android apps written against a much smaller C-based API surface provided in the Android NDK: Games. It is feasible to build Go support for Android providing the equivalent features found in the NDK."

Source: parent link (https://docs.google.com/document/d/1N3XyVkAP8nmWjASz8L_Ojjnj...)

Post reply on HN