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.

Posted on Sep 17 '18 by:

kspeakman profile

Kasey Speakman

@kspeakman

collector of ideas. no one of consequence.

Discussion

markdown guide
 

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.

 

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

 

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.

 

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/

 

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...