What are Compilers?
Computers must be programmed to do their job. These programs are written in some programming language a formal language with mathematical properties and well-defined meanings. A program written in a programming language must be translated before it can execute directly on a computer. This translation is performed by a software system called a compiler. A compiler is itself a computer program that takes as input an executable program and produces as output an equivalent executable program. In a traditional compiler, the input language is the programming language and the output language is either assembly code or machine code for some computer system. Part of the translation process also performs syntax analysis to ensure that the input program is valid. Compilers are designed according to two principles: • The compiler must preserve the meaning of the program being compiled. That is, the output code must faithfully reproduce the meaning of the source-code program. • The compiler must im