Compiling is the process of converting code from a high-level programming language into a low-level language that computers can understand. Computers can’t execute high-level code, so a compiler needs to translate it into binary code, or machine code, first.
There are 5 steps to compiling code:
- A programmer writes the source code
- A compiler checks ambiguous code
- A compiler checks source code syntax
- A compiler converts the code into machine language
- A compiler executes the code
Compile times vary from minutes to hours depending on the compiler, the languages, and the amount of code. Some compilers are ahead-of-time (AOT), meaning they start compiling before executing the code, and others are just-in-time (JIT), meaning they compile during execution. This depends on the language and what you’re using it for.