Here is the difference between compiler and interpreter:
• Compiler checks syntax of program
• Compiler checks at a time the entire program
• Program execution is fast
• Compiler takes entire program at a time and executes it.
• Interpreter checks the keywords of a program.
• Interpreter checks simultaneously in the editor.
• Program execution is quite slow.
• Interpreter executes the program line by line