Implementing a REPL is relatively straightforward for an interpreted language; the interpreter maintains the program state as normal, and evaluates each separate statement as normal, just using the same evaluation context for a whole interactive session.
The same cannot be said for compiled languages, since a compiler does not generally have a mechanism for maintaining program state across executions of different compilation units. How can a REPL be implemented using a compiler, without writing an interpreter separately for the language?