Difference between compiler and interpreter
I'm looking for the major difference between compiler and interpreter - the terms commonly used in computer programming and computer science. As the title suggests can any one briefly explain me the diff. between compiler and interpreter
Here's what I understand: A compiler is what the name suggests - compiler of the code. A compiler will read through all the code (computer instructions) and then turn it into an executable aka a file that contains machine readable binary code. Since the computer won't have to do much computing to execute a program that has been compiled, the execution will be much faster.
On the other hand, the Interpreter is something that 'interprets' in the real time. That is, the interpreter will go on reading the lines of code one by one and then execute whatever it encounters. A punch card reader would be a great example of an Interpreter where it reads each of the punched lines one by one and then takes action accordingly. An interpreter will mostly execute the high level instructions and therefore an interpreter will be slower in operations than the compiler.
One major difference between a compiler and interpreter is that once a code is compiled and if some changes are required, then the whole code will have to be compiled again. However, in case of an interpreter, the developer can change code at any point in time and it will be executed - without having to spend any time on understanding the change. I look forward to knowing more differences.