More concretely, I’m asking this: why aren’t applications compiled fully to native code before distribution rather than bytecode that runs on some virtual machine or runtime environment?

Implementation details aside, fundamentally, an Android application consists of bytecode, static resources, etc. In the Java world, I understand that the main appeal of having the JVM is to allow for enhanced portability and maybe also improved security. I know Android uses ART, but it remains that the applications are composed of processor-independent bytecode that leads to all this complex design to convert it into runnable code in some efficient manner. See: ART optimizing profiles, JIT compilation, JIT/AOT Hybrid Compilation… that’s a lot of work to support this complex design.

Android only officially supports arm64 currently, so why the extra complexity? Is this a vestigial remnant of the past? If so, with the move up in minimum supported versions, I should think Android should be transitioning to a binary distribution model at a natural point where compatibility is breaking. What benefit is being realized from all this runtime complexity?

  • AItoothbrush@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    edit-2
    1 year ago

    Yeah but at the same time if you support c++ for example its still extremely relevant language(i like c better tho…) and you could build support onto that stable base instead of using the $hitstorm called java. Well thats my opinion anyways. Maybe ease of use is more important and making phones that are powerfull enough to be used as a laptop is the right path forward. But making android more efficient would take a lot of other things and im not nearly qualified enough for this discussion.

    • lightrush@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Java performance has rarely been an issue in any environment, Android or otherwise. Recall that one of the most successful mobile OSes running on much slower chips than even the first Android was written entirely in Java - BlackBerry OS. C++ is great too but it requires a lot more competent engineers to do well. Modern C++ is spectacular. Yet often people we interview for C++ positions write C with cout in place of printf.