Types of Compilers

Published: 16th May 2011
Views: N/A

As the term itself states, the process involves compiling, or translating. Basically, a compiler is a program that processes statements written in a programming language (readable by humans) and converts them into a machine language or code that a computer can read. This provides the series of instructions to be understood by the system, and can this be executable.

The process itself is quite complicated and involves a number of steps. Depending on the particular case, and the type of compiler in question, this may include any of these processes - lexical analysis and semantic analysis, preprocessing, code generation and code optimization.

Compilers have an error handler, and they also differ in the type of error they generate. These are specifically classified as semantic and syntactic errors.

There are various types of compilers, as we shall be delineating hereunder.



Different types of Compilers



One-pass compiler



A one-pass compiler (also known as "narrow compiler") is a compiler that passes through the source code of each compilation unit only once. Due to this reason it is very fast. But the down-side of this is that mostly, it can only be used in simple programs.



Threaded code compiler



This type of compiler replaces given strings in the source with given binary code. Many FORTH implementations use threaded code and some use the term threading for almost any technique used to implement Forth's virtual machine.



Incremental compiler



This type of compiler was used in Lisp systems. It continued to be developed for imperative and interactive programming.



Stage compiler



This is used in Prolog machines for instance. The process involves compiling to assembly language.



Just-in-time compiler



Starting off in bytecode, and then compiling it into machine code just in time before the execution starts off.



Retargetable compiler



This type of compiler is used to produce code from various CPUs. However it is worth noting that the object code in this case is sometimes of a lower quality. This is due to the fact that this type of compiler is quite generic, as opposed to a compiler that was designed specifically for a particular processor.



Parallelizing compiler



This kind of compiler is used in systems composed of what is known as a parallel architecture. The serial input program is converted in such a way that it can be processed efficiently by the system.



There are several types of compilers, each having their particular characteristics to suit varying needs and systems. An overview can be found in the Cambridge encyclopaedia volumes and other sites, which describe their structure, techniques, possible errors and uses.

Report this article Ask About This Article


Loading...
More to Explore