REPL-Driven Development: Clojure's Superpower

Oh sounds cool, thanks Sean!

Made me try Reveal, really like it, its sleeker than REBL, I’m most likely gonna switch to it, and it’ll probably replace my Cider REPL window, and my use of Cider inspector.

I have updated my dot-clojure repo with a new alias (:dev) and a dev.clj script file that can start various REPLs, including Cognitect’s REBL, @vlaaad’s Reveal, and @bhauman’s Rebel Readline – depending on what is on your classpath.

Thanks to some digging around by @didibus, that script can combine Reveal and Rebel Readline, so you get a nice, rich REPL to type into (yeah, I know, I don’t do that but…) and everything is displayed in Reveal (plus anything you tap>).

When it starts Reveal, it also adds in some auto-table-view code, so anything you tap> into Reveal is automatically displayed in a table view, along with its metadata, and that view updates automatically every time you tap> something.

2 Likes

Didn’t Erlang solve the problem of continuous (and atomic) deployment? Perhaps we can pilfer some ideas

It will be interesting to see the commonalities and differences between Sean’s approach and mine. I hope more people share… Here is my general approach with Spacemacs

Video: REPL driven development in Clojure with Spacemacs

A 30 minute video showing how to develop a simple random function generator project in Clojure using REPL driven development with Spacemacs.
Spacemacs is a community configuration for Emacs and uses the CIDER project for its Clojure development environment.
The project uses Clojure CLI tools to run the REPL and uses the practicallli/clojure-deps-edn user configuration to access a range of community tools.
clj-kondo is used for static analysis, providing live linting as code is typed.
Practicalli Spacemacs - Practicalli Spacemacs also covers more general usage of Spacemacs and using the very powerful Vim-style editing approach.

1 Like

Cool thanks might see if I can get that up and running before your talk, but I’m still not understanding how to put stuff on my classpath, currently learning Java as well now.

Your dependencies (in lein’s project.clj file or the CLI’s deps.edn file) are what ends up on your classpath, plus your source / test code.

Ah OK thanks Sean, that probably leads me to the next thing that confuses me though - in an earlier version of your deps file it was pointing to REBL in a local folder but in a later version you had it pointing to a repository I think? Or a server? Not quite sure as that is the bit that confuses me. I think I will need to learn about Maven and Java repositories to understand better. I didn’t know how to replicate that on my machine so just stuck with your old deps file.

I think that was when you were using Xlaunch but I guess you’ve done away with that now you are using VS Code + Clover.

Re: REBL – for several releases, you had to download the REBL JAR manually (and therefore point your dependency at that downloaded file), then Cognitect made it available via a repository (so your dependency needed to point to the repository). I’m no longer using REBL (but you can still use it, via a local JAR or a repository).

Xlaunch (VcXsrv) is nothing to do with that (per se), nor is it anything to do with VS Code/Clover or Atom/Chlorine. It’s a Windows program that lets you run X11 apps (such as REBL or Reveal) from WSL2 but have it display on Windows.

Ah OK, thanks for the clarification :slight_smile:

A reminder that the first run of this talk is tomorrow, Tuesday, December 15th at 6 pm Pacific. Feel free to post any last requests for things to show in the demo portion. The second run will be Tuesday, January 12th at 10:30 am Pacific.

@seancorfield, do you know if this one will be recorded? The timezone mismatch it too high, and I’d love to see this before the scicloj one, if possible (just not to wait another month).

1 Like

Yes, it will be recorded, but the video won’t be posted until after I’ve also given this talk to the London group (which will also be recorded). The two different TZs mean most people should be able to attend live, I hope!

3 Likes

Ok, gotta wait, then :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.