Wednesday, 22 October 2014

Compilers and Interpreters


Compiler is actually a program that reads the code written in high level language and produces a executable that the CPU can understand. To run the executable you will not require the compiler. The below is the way how the compiler processes your high level code into the machine level language  


This is also a program that reads the code that compiles and executes the program.
The advantages of the interpreter are they are very easy to write the program than the compilers. The reason is interpreters are written in high level language.
The disadvantage is they are less efficiency, because they need to compile every tome the program IS RUN. The below is the steps of the interpretation process.

Any language can be compiled or interpreted; however, high level languages like C, C++, and Pascal are compiled, whereas “scripting” languages like Perl and Javascript are interpreted.

The below are the properties of high level languages:

1) These are much easier to read and write.
2) Requires instructions to perform the same task as lower level languages.
3) No need to worry about the details such as loading variables into CPU registers. The compiler or interpreter takes care of all those details for you.
4) They are portable to different architectures; the exception to portability is that many platforms, such as Microsoft Windows, contain platform-specific functions that you can use in your code. These can make it much easier to write a program for a specific platform, but at the expense of portability.
5) C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs.
6) This is a platform independent language; it supports Windows, Linux, Mac OS, and the various versions of UNIX.This reference will take you through simple and practical approach while learning C++ Programming language.

No comments: