logoalt Hacker News

faangguyindiayesterday at 11:29 PM1 replyview on HN

why OTA update OS that frequently?

I've been lately into mobile apps and i am finding that there is no system which combines these 3

1. AOT 2. JIT (for hot paths) 3. Interpreter for non JIT paths or where you explicitly do not want jit.

Imagine, a system which compiles your app to AOT but when you push OTA update, part of the app are selectively replaced to JIT or Interpreted mode.

it's theoretically possible but nobody seems to be doing it. I found react native / expo eas update but i don't think it's like this, it has a Hermes VM which runs bytecode but it has no JIT so you'll write native code for hot path then you'll need to upload a full update to Android. So, only toy level code performance can be can actually be written in JS?

Much better, patch the parts where AOT calls into JIT or interpreter.

Currently i am using react native and flutter. Flutter's UI framework code is in Dart if you load this whole code into JIT, it will consume a lot of resources on mobile device as the framework is big and does lot of work. If all framework code was AOT and your custom patchable code also comes with AOT but upon OTA replaced by JIT or Interpreted code, crazy performance!

But what if we could run the most of the code in AOT and only run changed code in JIT or interpreted mode? arguably it would perform as good as it does not being complete AOT while also providing react native like fast updates.


Replies

tcoff91yesterday at 11:35 PM

You can't update any AOT code due to how code signing works in these OS. And Apple completely bans JIT on iOS and iPadOS.

show 1 reply