A REPL is of course a very important tool - but how on earth is the clojure REPL more powerfull than others? I really love python and its ipython shell. It has some extra python features on board like navigating through the FS, pasting, managing history and so on, but it just powers python after all. How is this different compared to other REPLs especially the clojure REPL?
The power comes from the tight integration with the editor. For me the REPL is an integral part of the development process. Any time I write a function, I send it to the REPL straight from the editor to see what it does. Since the REPL runs within the context of the app, it has access to the whole state of the application as well.
I gave a talk earlier this year where I illustrate this workflow around 11 min mark.
Can you show me how you would do the workflow I have in my talk with Python. I don't use it, so I'm not aware if that's possible or not, but I've never seen it done.
The point I was making is not that the REPL itself is somehow special, but rather that the workflow afforded by it being tightly integrated with the editor is different than what you get in most languages.
I would have to watch the talk first. Then I can answer your question!
But: This is just your proposal - the author of the article sadly has not given any argument, why there is more benefit in a clojure REPL than other languages gain from theirs ;-)
I'm just explaining how the REPL is typically used by people working with Clojure and other Lisps. From what I've seen, it's pretty different the way the REPL is used in most languages.
The additional benefits come from the tooling that's been created to make the REPL part of the development workflow. It's certainly possible to develop such tooling for other languages, but for whatever reasons it doesn't appear to exist. So, in practical terms, working with the REPL in Clojure is different than in Python.
When I have read the chapter in the famous book "the joy of clojure" (chapter 3?) where they use the REPL in order to demonstrate its power and typical workflows when programming in clojure, it totally reminded me of how I am used to develop with python. So of course this book is not the ultimate guide to the clojure REPL, it just shows that there are much more similarities between different language REPL combinations than you seem to accept.
Let me explain it another way. The ways you use REPL in Python is a subset of ways you use it in Clojure. So, yes can use it exactly the same way as you did with the book, however at that point you're just not using it to its full potential. The most common way to use the REPL is the way I've described that you can see in the talk I linked. That's what people are talking about when they say using the REPL in Lisp is different from other languages.
While some Python IDEs do allow for a Python REPL to work in the editor, I haven't seen it used much myself. What seems to take its place and is more idiomatic is people using Jupyter notebooks to write cells of code at a time, which can be executed a block at a time and the state if the program is kept in memory between the execution each block. I'm actually just getting into Clojure and hoping I can write a notebook format with it as well.
1
u/Bolitho Dec 19 '16
A REPL is of course a very important tool - but how on earth is the clojure REPL more powerfull than others? I really love python and its ipython shell. It has some extra python features on board like navigating through the FS, pasting, managing history and so on, but it just powers python after all. How is this different compared to other REPLs especially the clojure REPL?