6 ms·
Here's a question - has Google made the move to ART for performance reasons or is it because it makes it possible to move to ... say.. Golang for Android ? Let
by sandGorgon 12y ago
Here's a question - has Google made the move to ART for performance reasons or is it because it makes it possible to move to ... say.. Golang for Android ?
Let me explain - One of the big reasons that Google cannot switch over to Golang (or Dart, or any other) is that the core of Android SDK is written in Java and therefore every app needs to work with Java to be able to tap into it.
However, ART can make it possible for SDK components to compiled down to object code, thus making it possible for Golang/Dart/etc. to link against it, while MAINTAINING backward compatibility with old java apps.
Will it allow new apps to be written in pure native code, without relying on the JNI bridge ?
- pjmlp 12y agoYou still need an common ABI and Java has a few features Go cannot understand and vice-versa. Android team stated multiple times that Java is the language of the platform.
- vetinari 12y agoNo, ART still works with dex bytecode, and native code still requires JNI bridge.
- izacus 12y agoART is still Java runtime which conforms to Java memory model, GC requirements and everything that comes with it. So no, you cannot just link random other languages without going through JNI. That is a common misconception. Also most of Android itself is managed Java code, so making other languages first-party citizens would require pretty much full OS rewrite. I very much doubt rewriting whole Android just to support non-JVM languages is worth it. Making ART VM fast, efficient and adding Java 8 bytecode compatiblity is I feel a much better use of development time. Wasting precious development time to placate devs that don't want to switch languagaes is - I feel - a hugely wasted effort.
- higherpurpose 12y agoI almost wish Google loses against Oracle at the Supreme Court, and is forced to pay Oracle billions every year as long as it continues to use Java, just so it's forced to switch away from Java. Almost, because I know Google losing that lawsuit could mean dire consequences across the industry. But it's still annoying that Android has to use Java and can't change away from it.
- WildUtah 12y agoClearly a win for Oracle would be a horrible disaster for the industry and freedom of speech. It would also be a huge relief and benefit to Android programmers once it forced Google to switch the platform to a less awful language.
- danieldk 12y agoWhat stops you from using Kotlin, Scala, or other languages that are available for Java VMs?
- cwyers 12y agoThis gets asked pretty often around here, and the answer (IIRC) is that in order to use any non-Java JVM language on Android, you have to link in a lot of libraries, and you start running into limits that Android puts on how much stuff you can pack into an executable.
- izacus 12y agoWhile mostly true, use of Kotlin has been rather nice with IntelliJ. Standard library is very small and out-of-the-box IDE support with Gradle plugin helps alot.
- on_and_off 12y agodo you mean the 64k method limit ? It does no longer exist (solved in 21, and a multi dex format has been introduced for earlier releases).
- on_and_off 12y agoGoogle made ART as Dalvik 2.0. The ecosystem evolves, the hardware evolves, the OS and its requirements evolve as well, so the runtime must follow. I don't think it changes anything to the JNI bridge. I can be wrong, but I don't think that it is a main area of focus for Google. This being said, Google is moving to a more pluggable build system (Gradle and its plugins) and runtime. Is it a nice benefit and only a side effet ? maybe, maybe not. Time will tell if Google want to move to Kotlin/Go/Dart/Scala/Rust/insert your pet language here. The official line is that moving the core libraries to something else would be an enormous amount of work and at the moment, they don't see the benefits outweighing the cost. It is possible that Google is secretly working on some other language, it is also possible that they intend to stick with Java and make it better instead (cue Dagger 2, Guava, AutoValue, ...).