A compiler is a software that translate source code (human readable) written in a high-level language to a low level language (assembly language or machine language or computer executable i.e. object code). There are many different types of compilers. For example: GCC C, Turbo C, Tiny CC etc.
Why do we need compiler?
Whenever you write a piece of code in high level language such as (C, C++, Java etc.) It needs to be converted into a series of 0s and 1s for the computer to understand.
A computer understands only binary language (series of 0s and 1s) and executes instruction coded in binary language. It cannot execute a singal instruction given in another form. Therefore, we must provide instruction in binary language.
Since we humans are good at giving instruction in English language, whereas computers understand only binary language. So there was a need of translator that translate the computer instruction given in English language to computer language (i.e. binary language). Hence, to accomplish the job a translator compiler was invented. The world's first compiler was written by Grace Hopper in 1952 for the A-0 Programming language.
Apart from translating source code from high level language to low level language, compiler has other responsibilities too. After reading source code written in high level language then checks for any syntactical or structural errors and if source code is error free, then generates object code with extension .obj (in Windows) or .o (in Linux).
The entire C compilation is broken to four stages.
- C compilation process.
Read more about-
Best C / C++ compiler for Windows and Linux:
- Intel C++ compiler: Intel C++ compiler is also known as ICC available for both windows and Linux.
- GNU compiler: The GNU compiler collection (GCC) is a compiler system produced by the GNU project. It was originally developed for C language but now supports many languages like C++, Java, etc. Available for windows and Linux.
- Dev C++: It is full featured compiler for the C/C++ programming language. Available for both Windows and Linux.
- Borland C++: It is a C and C++ IDE for MS-DOS and Microsoft Windows. It is good for beginners as it is simpler to use.
- Tiny C compiler: TinyCC (or TCC) is a small but hyper fast C compiler. Unlike other C compilers, you don't need to an external assembler or linker because TCC does that for you. Available for both Windows and Linux.
- MinGW: It supports both C and C++. A key benefits of it is fast and simple and requires DLL libraries. This is available for Windows only.
- Visual C++ compiler: A Microsoft Visual C++ compiler is a good compiler for developing Windows applications. Available for Windows and Linux.
Difference between Interpreter and Compiler:
To be updated soon...
0 Comments:
Post a Comment
Please don't enter any spam link in the comment box.