Compiler and Interpreter || Difference between compiler and interpreter | compiler vs interpreter

preview_player
Показать описание
#Compiler #Interpreter #COMPILER_vs_INTERPRETER #Difference_between_compiler_and_interpreter
Welcome back to the series of introduction to computer programming in the last lecture we have discussed about high and low level programming languages in high level programming language compiler and interpreter are used.
In this video we will discuss about the main differences between compiler and interpreter both are software used to translate a high level programming language to machine code starting with the compiler a compiler is a computer program or software that translates a source code written in a high level language for example c into a set of machine code that can be executed by a machine or cpu the compiler take the entire program you wrote in high level programming language and translate the complete code into a machine code at once the complete code is translated into executable file which is ready to run on a machine a compiler is more intelligent it checks for all kind of limits ranges and errors compiler also checks for syntax error if there is any error the process of translation of a program to
executable file will fully stop and no object file is created and the error will be displayed at the end of compilation means no machine code is generated the process of generating an executable file from object file will be discussed later on
Now we will discuss about the interpreter an interpreter is a computer program that translates a high level code into
machine code instruction by instruction the cpu executes each instruction before the interpreter moves on the next
instruction the great thing about interpreter is that the program will fully execute until an error occurs error will be displayed after each instruction that contains it here you can see the first instruction in the code is shown in the black color the interpreter executes it and displays the letter h now moving on to the next instruction which is shown in the red colorthe interpreter executes it and displays a letter e and the process continues
Now coming to the differences between interpreter and compiler
compiler translates the whole program in one go
while interpreter translatesprogram one statement at a time
compiler scans the code in one go the errors are shown at the end all together
interpreter scans code one line at a time error are shown line by line an
advantage of the compilers is its execution time
interpreters are slow in executing a program
compiler converts the source code into object code
interpreter does not convert source code into object code instead it scans it line by line
compiler does not require source code for later execution
interpreter requires source code for later execution
compiler examples are C C++ and java
while interpreters are python perl matlab
hope this is informative for you
thanks for watching ALLAH Hafiz
Рекомендации по теме
Комментарии
Автор

Quite informative...
Great video sir...👍

babarzeb
Автор

MashaAllah keep up ur good work from Ahsan khan

KhanBaba-swrg