Difference between Interpreter and Compiler

We hope that you’re already familiar with term high-level languages and what are known high-level languages. If not the high-level programming language is a programming language with strong abstraction of the computer. In comparison to low-level programming languages, it may use natural language elements, be easier to use, or may automate significant areas of computing systems, making the process of developing a program simpler and more understandable relative to a lower-level language.
Some of the high-level programming languages are:
·         Python
·         Java
·         C++
·         PHP
·         Ruby
·         Basic
·         Perl
·         JavaScript
The CPU or central processing unit understands a language we call machine-language. This language is very simple because it is represented all in zeros and ones. This is a binary system. For humans this language is very exhausting and time consuming because imagine if you write all your documents in 0s and 1s.
Only few programmers ever write machine language. That’s way the engineers and computer scientists created translators and they allow us as users/programmers to write high level languages like Python or JavaScript and these translators convert the programs to machine language. They prepare our task for execution in CPU.
The machine language is tied to the computer hardware so it’s not portable across different platforms while programs that are written in high-level languages can be moved between different computers by using diferent interpreter on the new machine or re-compiling the code to create a machine language versions of the program for the new machine.
Programming language translators can be divided into two general categories and these are:
Interpreters – reads the source code of the program as written by programmer, parses the source code, and interprets on the fly. Python is an interpreter and when we are running Python interactively, we can type a line of Python and Python processes it immediately and is ready for us to type another line of Python.
Compiler needs to be handed the entire program in a file and then it runs a process to translate the high level source into machine language and then the compiler puts the resulting machine language into a file for later execution.


Nema komentara:

Objavi komentar