An ahead-of-time (AOT) compiler is a compiler that implements ahead-of-time compilation. This refers to the act of compiling an intermediate language, such as Java bytecode, .NET Common Intermediate Language (CIL), or IBM System/38 or IBM System i "Technology Independent Machine Interface" code, into a system-dependent binary.
Most languages with a managed code runtime that can be compiled to an intermediate language take advantage of just-in-time (JIT). This, briefly, compiles intermediate code into machine code for a native run while the intermediate code is executing, which may decrease an application's performance. Ahead-of-time compilation eliminates the need for this step by performing the compilation before execution rather than during execution.
Ahead-of-time compilation for dynamically typed languages to native machine code or other static VM bytecode is possible only in a limited number of cases. For example the HiPE AOT compiler for Erlang can do this because of advanced static type reconstruction techniques and types speculations.
AOT compilation is mostly beneficial in cases where the interpreter (which is small) is too slow or JIT is too complex or introduces undesirable latencies. In most situations with fully AOT compiled programs and libraries it is possible to drop considerable fraction of runtime environment, thus saving disk space, memory and starting time. Because of this it can be useful in embedded or mobile devices.
AOT in most cases produces machine optimized code, just like a 'standard' native compiler. The difference is that AOT transforms the bytecode of an existing virtual machine into machine code. AOT compilers can perform complex and advanced code optimizations which in most cases of JITing will be considered much too costly. On the other hand AOT can't usually perform some optimizations possible in JIT, like runtime profile-guided optimizations, pseudo-constant propagation or indirect/virtual function inlining.
See also 
- SharpOS AOT (CIL)
- IL2CPU (CIL)
- Native Image Generator (CIL)
- GNU Compiler for Java
- Excelsior JET (Java)
- Application Object Tree (.NET) For disambiguation. MSDN article: http://msdn.microsoft.com/en-us/library/aa843974.aspx
- Speed: NGen Revs Up Your Performance with Powerful New Features -- MSDN Magazine, April 2005
- Mono AOT
- Excelsior JET -- Java SE 6 Implementation with AOT compiler
- GNU Compiler for Java
- Aonix PERC Ultra
- Real-time Java, Part 2: Comparing compilation techniques -- IBM developerWorks, April 2007
- Improving Swing Performance: JIT vs AOT Compilation -- LinuxWorld Magazine, November 2004
|This programming tool–related article is a stub. You can help Wikipedia by expanding it.|