DEV Community

loading...

What is Clojure(/Script)'s best first run and tooling experience?

kspeakman profile image Kasey Speakman ・1 min read

I'm interested in trying Clojure and/or ClojureScript. However, I admit to being a bit spoiled on tooling.

A luxury, once enjoyed, becomes a necessity.

  • C. Northcote Parkinson

What is the best (non-Emacs) first-run and ongoing tooling experience? Free is best, but compelling paid options are ok. What I'm accustomed to currently:

On the front end I use Elm. There is a great template project called Create-Elm-App that sets up the production builds and dev goodies like hot reloading, time-traveling debugger, etc. Then I use VS code for the normal stuff (highlighting, git integration, file organization, intellisense, etc).

On the back end I use full VS, which has project templates, debugging, and nowadays even docker integration (will setup debuggable containers for you). In addition to the normal stuff.

Discussion (8)

Collapse
jreighley profile image
jreighley

Nightcode sekao.net/nightcode/ is a good option if you are just wanting to get your feet wet and test and see how clojure works..

For more serious development, Atom with proto-repl is a good option. It has relatively simple setup, shallow learning curve, but gives you most of the features that make Clojure fun to use.
gist.github.com/jasongilman/d1f705...

Eventually most clojurists seem to land on Emacs with Cider or IntelliJ with Cursive.

Cursive is free for open source, but pay for commercial use -- It's advantage is that it does a lot of very nice static analysis highlighting, refactoring tooling etc.

Collapse
seanthegreat profile image
Sean Antony Brunton

Yeah.. The next best Editor for Clojure, aside from Spacemacs or Emacs is IntelliJ IDEA, using the Cursive plugin.. It's so automated and constantly checks your code. I like it.. I find it a bit more user friendly than Spacemacs or Emacs.. However I personally think it's down to personal preference, to me your preference should with be Spacemacs/Emacs or IntelliJ IDEA with the Cursive plugin for Clojure, which can interact with both Clojure CLI and Leiningen.. I like to use Leiningen.. Just seems more robust to me personally.. I like IntelliJ because it is traditionally adapted for Java, which is what Clojure works with.. It's so nicely automated l, and the interaction with the JVM is like magic. The only time you touch your terminal is when you want to run a REPL.. Still and also Figwheel is just the bomb man.. I love the "eMac-like" REPL.. Called Rebel-Readline.. Just such a joy to use, but it took a while and silly trail errors to get all working as I wanted. It's either Spacemacs or IntelliJ IDEA with the Cursive plugin for Clojure development on the IDE. Keep rocking bud!

Collapse
kspeakman profile image
Kasey Speakman Author

Hey, thanks for the suggestions!

I ended up using VS Code with the Calva plugin. I found VS Code a good option because I am already familiar with it. I wrote a short post on how I set it up to run in a container so I don't have to globally install the JVM on my machine.

I used shadow-cljs to setup the project, and it seems to work well. It adds hot reloading.

Thanks again for your comment!

Collapse
seanthegreat profile image
Sean Antony Brunton

Yeah I have VS Code, for some reason I will use that to write Python, as I like to run Jupyter Notebooks from time to time, it's a cool way to learn about something. Just seems better for it (again it's really down to preference). Yep hot reloading is awesome man, I add comments to my code all the time, save just for the hell of it, so that I can see it work. Really cool.

I have this thing in my head that if I work closely with Leiningen, as opposed to CLI, I would better access to ring and it middleware. Figwheel and many other are just built on top of Ring. Just my nature I suppose. Having said that shadow-cljs is more "hands-on" (don't know how else to describe it), give more like turnkey to front end. I'm stubborn though. LoL!

Collapse
17cupsofcoffee profile image
Joe Clay

Figwheel seems to be the most popular solution for ClojureScript hot reloading. Using that in combination with the Figwheel Leiningen template should give you something decently close to create-elm-app.

Disclaimer - not a ClojureScript programmer, just bored and thought I'd help research :p

Collapse
kspeakman profile image
Kasey Speakman Author • Edited

Thanks for mentioning that. I saw Figwheel, and I was also looking at Re-frame since it seems Elm-like. (I far prefer functional MVU over component-based React.) Thanks to your suggestion, I found a re-frame template.

Still open questions on good editor experiences while using the template. I wonder how smooth the experience in VS Code is since I am already familiar with that. I've also used SublimeText before, but just for simple text editing.

Collapse
overde profile image
Danilo Verde

VS Code is my main for anything else but clojurescript.
I advise you to go with Cursive, it had a blast. Please it's no more than 15 minutes and you'll fell at home.
cursive-ide.com/userguide/

Collapse
johncip profile image
jmc • Edited

If there are any vim users reading this -- hopefully you already have vim-surround and vim-repeat. To those I recommend adding vim-fireplace, vim-salve, vim-sexp, and vim-sexp-mappings-for-regular-people. And then paredit or parinfer depending on how automated you want your paren handling to be. I prefer paredit (and even that I end up fighting with sometimes).

I use neovim and tried to add clj-refactor to the above so that I could e.g. extract functions easily, but it did funky things to my REPL connection. In particular, the printing of error messages was always a hair flaky, but after adding the clj-refactor they stopped printing at all. (But I'm guessing that's due to the vim-cider dependency and not clj-refactor itself.)

All in all, it's really nice having vim connected to a live REPL, and being able to evaluate code under the cursor. I can write and test code in a single editor window! IMO it's hard to imagine in advance how nice that is, but once you're doing it, it's a little nuts.

Edit: oh, March 2018 -- sorry for gravedigging...

Forem Open with the Forem app