4 ms·
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
by YZF 9y ago
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.
- gizmo686 9y ago>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.
- jayd16 9y agoActually, 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.
- graetzer 9y agoYou 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.
- jayd16 9y ago>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.
- YZF 9y agoHow is an Android an example? What AOT are we comparing to here?