A REPL has a rather specific meaning. "True REPL" will match the following pattern: Read Eval Print Loop. You can build REPL in clojure with just a few lines:
(loop [] (let [string (read-line) data (read-string line) result (eval data)] (println result) (recur)))
Here you see the main parts of true repl. read-line reads text from the console. read-string converts this string to data (lists, vectors, numbers, etc.). eval evaluates the data returning the result, and println prints the result.
Some argue (and I agree) that only those systems that follow these four steps can be called repl. And some would also point out that Scala is not homo-conic, and therefore cannot have truly repl.
By homoiconic, I mean that the compiler works with the same data structures that are created by the language reader, and is controlled by the language core constructs. For example, this is a perfectly valid clojure code:
(eval (list (symbol "+") 41 1))) ; evals to 42
So, the gist of the discussion on the βrealβ REPL. Only homoiconic languages, such as lisp (and perhaps prologue?), Can have true REPL. Everyone else should really be called "interactive translators."
As for the speed. This is probably due to the complexity of the compiler. The clojure compiler is only about 10 thousand lines of fairly linear code. Single passage, nothing special. The Scala compiler is pretty advanced, supporting things like static typing and multiple passes. These additional features are not needed in a language such as Clojure, and they tend to slow down the compiler.
source share