Note:I don’t mean some theoretical question which don’t have any implementation just languages that don’t have both!!!!!
These days there exists a c/c++ interpreter(cint) and a python compiler(to python bytecode).
I understand that the simplest definition is that a compiler just converts code from language a to language b, and then you have a machine which runs b it together with input, while an interpreter is simply something that takes input plus code in language a and runs it. And that using these definitions if something has an interpreter or compiler its fairly simple to get the other by immediately running the output of the compiler or embedding the compiler w/ the source code to get an interpreter.
So ignoring those which languages don’t have both a compiler (which compile source code in A to B preferably an intermediate language) and an interpreter that run large chunks of code without compiling them?
An interpreter translates some form of source code into a target representation that it can immediately execute and evaluate. The structure of the interpreter is similar to that of a compiler, but the amount of time it takes to produce the executable representation will vary as will the amount of optimization. The following diagram shows one representation of the differences.
graphic
Compiler characteristics:
Interpreter characteristics:
(source: gpollice at web.cs.wpi.edu)