I am not convinced that immutability matters; this seems like a bias. After all the original REPL, and the name itself, was in Lisp (note that the first Lisp implementations were not interactive, but it was the first interactive language) and Lisp doesn't have immutable data structures. (READ, EVAL, and PRINT are all old Lisp primitives, and the REPL was literally implemented with them. There's also a complex macro c…
I normally only use a repl when I don't know what I'm doing.
My normal process with a repl in an immutable language goes like this:
1. Assign something to a name
2. Realise that was wrong, try again.
3. Get told no. Remember to tell the repl to forget the wrong one and do it again (or choose a new name).
4. Try to assign something else to another name (probably 'foo')
5. Realise that I already used foo about an hour ago in a different experiment, and hadn't closed the repl in between.
Immutable is great for actual programming. Less so for quick experiments.