Re:Android Is a Dead End
by YZF on Sunday July 16, 2017 @08:46PM
(#14784926)
What's an example of an ahead-of-time compiler that takes bytecode and spits out native code? Can you do inline assembly for the target architecture? I heard a million time how JIT and JVM "could be" just as fast (or some claim faster) than AOT but in practice it hasn't happened. High performance code is written in AOT/native languages.
[ Parent
| on HN ]
You can definitely do ahead of time compilation with .net bytecode. That's why you can write iOS apps in c# with xamarin's SDK.
I think the performance differences between JIT compiled code and native code mainly come from the 'convenience' features offered by languages such as Java or C#. I am thinking of garbage collection, (default) virtual functions or reflection.
In let's say c++ you can do all of these things too, but the cost is not hidden from the developer.
>What's an example of an ahead-of-time compiler that takes bytecode and spits out native code?
I believe that is how .NET works (the byte code gets distributed, and the user compiles it to native immidietly before execution).
Also, Android's ART is the replacement for Dalvik that compiles Dalvik bytecode into native code at installation.
Actually, ART is now "JIT guided AOT." The JIT will (re)compile code as needed but the JIT code is stored to disk, thus creating an AOT binary on future runs.
>I heard a million time how JIT and JVM "could be" just as fast (or some claim faster) than AOT but in practice it hasn't happened.
Why do you say this? There's lots of examples out there and Android is one of them.