3 ms·
It's a shame. Android _should have_ from the beginning used: Linux containers, a modified JVM profile, Android libraries as regular java dependencies, etc.
by exabrial 4y ago
It's a shame. Android _should have_ from the beginning used: Linux containers, a modified JVM profile, Android libraries as regular java dependencies, etc.
- pjmlp 4y agoAt least they updated Android 12 to Java 11 LTS, and Android 14 will get Java 17 LTS. However it is a subset as usual, and most likely because they are already starting to feel that Kotlin also needs those Java libraries which are leaving Java 8 behind, unless they feel like rewriting Maven Central universe into Kotlin.
- kaba0 4y agoYou seem to be knowledgeable about the Android situation - what’s the current deal? From what I gathered, android uses a hybrid runtime that has many parts of the code AOT compiled and cached, but can JIT compile as well to suit for a particular device, is my understanding correct? But yeah, I agree with you, they really should have gone with possibly a simpler JIT compiler and an alternative GC implementation that is more conservative in memory usage.
- saagarjha 4y agoWhat's wrong with the current one?
- pjmlp 4y agoHere for the JIT/AOT, since Android 7 (5 and 6 used AOT only), https://source.android.com/docs/core/runtime/jit-compiler?hl=en https://source.android.com/docs/core/runtime/jit-compiler?hl... The issue isn't even converting JVM bytecodes into DEX, other compliant Java implementations for embedded do similar approaches, see PTC and Aicas. The issue is how they have stagnated Java support on purpose as means to push Kotlin, they aren't being innocent by using Java 8 samples against Kotlin features. And the whole but Oracle doesn't cut it, given how dependent Kotlin is on the whole JVM ecosystem.
- _old_dude_ 4y agoIt starts that way, with a mark and sweep collector (think Java CMS or the GC of Go). But some applications like games or Facebook are monsters so the GC was changed to a copy collector which has a better throughput, avoid fragmentation at the cost of using more memory. Also the code is not just AOTed, Android is using profile guided AOT. After several days of usage, the code is AOTed with the profile collected from previous runs.
- saagarjha 4y agoJava on Android is a miserable experience because of how far behind it is. That you can't really guarantee that anything past Java 1.7 is available means that everyone just writes to that lowest common denominator (of course, there's plenty of legacy code too…)
- pjmlp 4y agoYes, how else would they push their Kotlin agenda, if modern Java was given the same access. See how little everyone cares on the JVM, it is just another guest language alongside Scala, Clojure and Groovy competing for attention.
- jraph 4y agoI don't really understand your comment. - What do they win by pushing Kotlin against Java (for reasons that are not also beneficial to developers)? The word "agenda" makes it seem like they have evil intents - Doesn't Kotlin depend on the JVM, and so wouldn't it benefit from an upgrade - Isn't Kotlin a programming language that uses the JVM and the Java standard library anyway? (I saw a bit of Kotlin, I contributed a small patch to QKSMS, it seems it is a bit like Groovy in that it is an alternative syntax but is essentially Java with some syntax sugar and some additional classes to make some tasks easier) I understand that Kotlin may not directly benefit from the new Java language features, but it seems like it would benefit from all the other advances. (I'm not defending Google, I don't like them)
- re-thc 4y agoKotlin is a safety net because Google/Android vs Oracle (the lawsuit).
- pjmlp 4y agoNot really, because Kotlin is useless without JVM ecosystem. InteliJ/Android Studio, Gradle and Maven Central libraries. Kotlin/Native was so well done that they had to reboot the effort. If they cared about so much, they should have migrated to Dart instead.