Our website use cookies, which help us to improve our site and enables us to deliver the best possible service and customer experience. By clicking accept you are agreeing to our cookies policy. Find out more
If you notice any factual inaccuracies or other issues with this profile, please let us know. Please do not include any personal health information in this form.
Like Answer
Guess you are aware that computer speaks only one language(i.e binary :- everything in terms of 0s and 1s) at which humans are very bad or not comfortable.
We write programs which are then converted into binary code using the compiler or interpreter.
Hence, a compiler or an interpreter is a program that converts program written in high-level language into machine-level language.
So destiny for both Complier/interpreter same but the way they work is different.
Interpreter:
1.converts only one statement of a program at an instance of time to binary.
2.So, as interpreter checks the errors of a program statement by statement. After checking one statement, it converts that statement into machine code and then executes that statement. The process continues until the last statement of program occurs.
3.Interpreter does not generate any machine/object code.
4.As they don't generate any machine/object code, occupies less memory (memory efficient)
5.interpreted programs are to interpreted everytime they are run.
6.Debugging is easy.
7.Interpreter runs the program from first line and stops execution only if it encounters an error.
Compiler:
1.Converts entire statements of program to binary at once.
2.So, a compiler searches for all errors in a program and lists. If the program/code is error free then, it converts into machine code and then the program can be executed.
3.As entire code gets converted and has to keep in memory, compiler generates separate code called machine/object code.
4.Compiled programs takes more memory because of the way it work.
5.compiled programmed need not be complied everytime.i.e compile once and run manytimes.
6.Debugging is not easy.
7.Compiler does not allow a program to run until it is fully error-free.