An interpreter translates a program into machine code one line at a time. A compiler, however, scans the entire document and translates it into machine code as a whole. The overall execution time of an interpreter is longer than that of a compiler. Languages such as Python use are interpreted, and languages such as C and C++ are compiled.