"A compiler was originally a program that "compiled" subroutines [a link-loader]. When in 1954 the combination "algebraic compiler" came into use, or rather into misuse, the meaning of the term had already shifted into the present one."
<ref>Bauer, F. L. And Eickel, J. 1975. ''Compiler Construction: An Advanced Course.'' Springer-Verlag, New York.</ref>
[[Image:Ideal compiler.png|right|thumb|300px|A diagram of the operation of a typical multi-language, multi-target compiler.]]
A '''compiler''' is a [[computer program]] (or set of programs) that translates text written in a [[programming language|computer language]] (the ''source language'') into another computer language (the ''target language''). The original sequence is usually called the ''[[source code]]'' and the output called ''[[object code]]''. Commonly the output has a form suitable for processing by other programs (e.g., a [[linker]]), but it may be a human-readable [[text file]].
The most common reason for wanting to translate source code is to create an [[executable]] program. The name "compiler" is primarily used for programs that translate source code from a [[High-level programming language|high level language]] to a lower level language (e.g., [[assembly language]] or [[machine language]]). A program that translates from a low level language to a higher level one is a ''[[decompiler]]''. A program that translates between high-level languages is usually called a ''language translator'', ''source to source translator'', or ''language converter''. A ''language [[rewriting|rewriter]]'' is usually a program that translates the form of expressions without a change of language.
A compiler is likely to perform many or all of the following operations: [[Lexical analysis|lexing]], [[preprocessor|preprocessing]], [[parsing]], semantic analysis, [[code generation (compiler)|code generation]], and [[compiler optimization|code optimizations]].
[[Assembly language]] is not a high-level language and a program that compiles it is more commonly known as an ''assembler'', with the inverse program known as a ''[[disassembler]]''.