What is the difference between a compiler and an interpreter?
What is the difference between a compiler and an interpreter?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
1. A compiler translates code written in a high-level programming language into a lower-level language like assembly language, object code and machine code (binary 1 and 0 bits). It converts the code ahead of time before the program runs whereas an interpreter translates the code line-by-line when the program is running.
2. A compiler takes in the entire program and requires a lot of time to analyze the source code whereas the interpreter takes a single line of code and very little time to analyze it.
3. Compiled code runs faster, while interpreted code runs slower.
4. A compiler displays all errors after compilation. If your code has mistakes, it will not compile. But the interpreter displays errors of each line one by one.
5. Compilers can contain interpreters for optimization reasons like faster performance and smaller memory footprint.