I just want to point out that Python and Julia do not have REPLs in the way that the Clojure community normally defines them.
They have what I would call a command shell, which is a command line application that can be sent commands and evaluate them and print their result.
Generally though, in Clojure, when people talk about the REPL, REPL-driven-development or why REPLs are awesome, they’re not talking about that.
What Clojurists most often mean by REPL is a live integrated inside an application REPL that lets you evaluate and hot-swap every single line of code at will and on-demand all at runtime without ever needing to restart the application, while also being able to inspect the runtime state at will.
A lot of languages have command shells, very few have fully integrated live REPLs in this vein.
I’m not sure if anything would prevent them to have such REPL, but I haven’t heard them having one.
So in Clojure a REPL is almost better thought of as an IDE, they can auto-complete, list variable usage, show documentation, show functions available in a namespace, run tests, and additionally to those common IDE features, they can also hot-swap code forms, evaluate arbitrary code forms, pretty print their result, etc, and this all happens for your program over your actual source files in your editor of choice.
I think the closest thing to relate to it is that it’s very close to the Inspectors inside browsers when you press F12, just more general to any program and running inside an editor instead of inside a browser.
I’d like to think this has improved a lot now that we have the Clojure CLI and tools.deps, but I might be wrong.
I’d say if you want the same simplicity to get started as Python, you should look into Babashka https://book.babashka.org/
In fact I’d say it’s probably a great place to start your journey:
- Download the
bb
binary and put it on your PATH
- Run it to get a command shell:
bb
- Create a file with Clojure code in it and run it with:
bb my-file.clj
The other advantage of starting with Babashka is that you won’t need to worry about what library to use to do what, you don’t have a choice
, it comes batteries included with its own set of libraries for most things, and that’s all you can use (well when getting more advanced you’ll learn that you can if you really want use more libraries then the included ones, but you won’t reach that point for a while, so don’t worry about it).
And if you’re confused about how learning Babashka is similar to learning Clojure, well it’s because Clojure is the programming language, and Clojure JVM, Clojure CLR, ClojureScript, Babashka are implementations of that language for various runtimes. They all use the same language, which is Clojure.
Since you don’t know programming or Clojure very well yet, I would say understanding the implications and peculiarities of different runtimes isn’t important for you yet. You can learn all the basics of programming and Clojure with Babashka, and worry about the infrastructure and runtime differences once you’ve mastered that.