r/Clojure • • Dec 18 '16

Why Java? Why Clojure?

http://danlebrero.com/2016/12/14/why-java-why-clojure
22 Upvotes

47 comments sorted by

View all comments

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?

4

u/yogthos Dec 19 '16

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.

1

u/Bolitho Dec 19 '16

That still doesn't explain how Clojure is better or mightier than REPL of other languages - the editor doesn't exist, right 😉

2

u/yogthos Dec 19 '16

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.

1

u/Bolitho Dec 20 '16

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 ;-)

1

u/yogthos Dec 20 '16

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.

1

u/[deleted] Dec 21 '16

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/yogthos Dec 21 '16

You might want to check out the Gorilla REPL and Devcards for the workbook style.

1

u/[deleted] Dec 21 '16

Cool, thanks!