Comparison of Compiler and Interpreter

Basis for comparisonCompilerInterpreter
InputIt takes an entire program at a time.
It takes a single line of code or instruction at a time.
OutputIt generates intermediate object code.It does not produce any intermediate object code.
Working mechanism
The compilation is done before execution.Compilation and execution take place simultaneously.
Speed

Comparatively fasterSlower
Memory

Memory requirement is more due to the creation of object code.It requires less memory as it does not create intermediate object code.
Errors
Display all errors after compilation, all at the same time.Displays error of each line one by one.
Error detectionDifficult Easier comparatively
Pertaining Programming languages
C, C++, C#, Scala, typescript uses compiler.PHP, Perl, Python, Ruby uses an interpreter.