A software tool that converts (typically human written) programming languages into assembly language, and sometimes directly into machine code.
Compilers actually perform many complex tasks, including:
- syntax checking – ensuring the developer has conformed to the rules of the language, and reporting warnings or errors as appropriate.
- optimization – removal of unused code; reordering of code that improves efficiency without changing the output (either to reduce memory requirements and/or improve computational speed). Optimization settings can typically be controlled by the developer and can have a significant impact on the speed and timing of software.
- compilation – conversion from one language to another (typically assembly language).
Some modern compilers may embed the role of the assembler, which is a software process of converting (human readable) assembly language into binary data known as machine code (CPU readable). Some may compile straight to machine code.