Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Unless you are giving google your rust code to compile, your app will be limited on it's reach.

Android has supported native code in apps for a long time via the Android NDK, mainly to enable game development. The Android team seems to hate the NDK, but the alternative is to have no games on the platform, so they can't simply kill it.

> ...[native] ... It's not exactly great for runtime performance as it takes away some key optimizations.

In theory a JIT might produce better runtime performance than AOT compiled code, but in practice that usually turns out as wishful thinking.



Thankfully ART not only uses JIT, it also has an AOT compiler with PGO data shared across all devices in the ecosystem via the Play Store.

In practice, people should learn how Android actually works.


This just seems to prove my point that AOT is usually better than JIT?


Not really, because not only it uses PGO, which most people using AOT languages never bother to learn, it only AOT compiles the code paths that JIT validated as being used, instead of the whole application.

JIT + AOT with PGO data shared across all Android devices on the planet, gets the best of both worlds.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: