Definition of a Translator
Language translators convert programming source code into language that the computer processor understands. Programming source code has various structures and commands, but computer processors only understand machine language. Different types of translations must occur to turn programming source code into machine language, which is made up of bits of binary data. The three major types of language translators are compilers, assemblers, and interpreters.
Definition of a Compiler
A compiler is a type of language translator. It is a set of instructions(Software) that translates (compiles) source code written in a high-level language (e.g., C/C++, COBOL, C++) into ...view middle of the document...
A translator usually has to generate structured, maintainable code in the target language which makes use of idioms in the target language where possible.
A compiler can generate any code it likes so far as it is syntactically valid for the target language.
2. A compiler has to cope with any valid syntax in the source language,and generate semantically equivalent code in the target language.
A translator usually has a fixed body of code that it is required to translate.
3. A compiler usually has to do optimisation. A translator can rely on the compiler for the target language to do optimisation: in fact, it should not do optimisations which affect readability of the code.
4. A compiler is translating from a higher level language to a lower level language (or to a low level subset of the target language). A translator is usually translating from a high level language to another high level language or from a low level language to a high level language. For example, translating from assembler language to C or COBOL