Science, Tech, Math › Computer Science What Is a Programming Compiler? Ahead-of-Time Compilers Vs. Just-in-Time Compilers Share Flipboard Email Print Hero Images / Getty Images Computer Science C & C++ Programming PHP Programming Perl Python Java Programming Javascript Programming Delphi Programming Ruby Programming Visual Basic View More By David Bolton David Bolton Computer Science Expert B.A., Computer Science, Queen's University Belfast David Bolton is a software developer who has worked for several major firms, including Morgan Stanley, PwC, BAE Systems, and LCH. Learn about our Editorial Process Updated on July 03, 2019 A compiler is a software program that converts computer programming code written by a human programmer into binary code (machine code) that can be understood and executed by a specific CPU. The act of transforming source code into machine code is called "compilation." When all the code is transformed at one time before it reaches the platforms that run it, the process is called ahead-of-time (AOT) compilation. Which Programming Languages Use an AOT Compiler? Many well-known programming languages require a compiler including: FortranPascalAssembly LanguageCC++Swift Before Java and C#, all computer programs were either compiled or interpreted. What About Interpreted Code? Interpreted code executes instructions in a program without compiling them into machine language. The interpreted code parses the source code directly, is paired with a virtual machine that translates the code for the machine at the time of execution, or takes advantage of precompiled code. Javascript is usually interpreted. Compiled code runs faster than interpreted code because it doesn't need to do any work at the time the action takes place. The work is already done. Which Programming Languages Use a JIT Compiler? Java and C# use just-in-time compilers. Just-in-time compilers are a combination of AOT compilers and interpreters. After a Java program is written, the JIT compiler turns the code into bytecode rather than into code that contains instructions for a specific hardware platform's processor. The bytecode is platform independent and can be sent and run on any platform that supports Java. In a sense, the program is compiled in a two-stage process. Similarly, C# uses a JIT compiler that is part of the Common Language Runtime, which manages the execution of all .NET applications. Each target platform has a JIT compiler. As long as the intermediate bytecode language conversion can be understood by the platform, the program runs. Pros and Cons of AOT and JIT Compilation Ahead-of-time (AOT) compilation delivers faster startup time, particularly when much of the code executes at startup. However, it requires more memory and more disk space. JOT compilation must target the least capable of all possible execution platforms. Just-in-time (JIT) compilation profiles the target platform while it runs and re-compiles on the fly to deliver improved performance. JIT generates improved code because it targets the current platform, although it usually takes more time to run than AOT compiled code. Cite this Article Format mla apa chicago Your Citation Bolton, David. "What Is a Programming Compiler?" ThoughtCo, Aug. 27, 2020, thoughtco.com/definition-of-compiler-958198. Bolton, David. (2020, August 27). What Is a Programming Compiler? Retrieved from https://www.thoughtco.com/definition-of-compiler-958198 Bolton, David. "What Is a Programming Compiler?" ThoughtCo. https://www.thoughtco.com/definition-of-compiler-958198 (accessed May 30, 2023). copy citation