A compiler is a computer program that translates computer code written in one programming language into another language. It takes in source code written in one language (called the source language) and returns source code in another language (called the target language) . The target language is usually machine code that can be executed by a computer.
Compilers are different from interpreters, which execute source code directly line-by-line without compiling it into machine code. Compilers analyze and convert source code written in languages such as Java, C++, C#, or Swift into machine code or bytecode that can be executed by the target host system.
Compilers have been used to develop influential systems programming languages such as BCPL, which was designed in 1966 by Martin Richards at the University of Cambridge as a compiler writing tool. BCPL provided a basis for the design of B and C languages.