r/Clojure • • Apr 04 '20

Guide to starting with Clojure

https://grison.me/2020/04/04/starting-with-clojure/
77 Upvotes

16 comments sorted by

12

u/frflaie Apr 04 '20

Hi clojurians!

I recently gave a talk at work to show why Clojure is a good fit and show some of the possibilities and its ecosystem.

People got interested and wanted to try stuff but were overwhelmed with what to choose (lein, deps, boot) which editor to use, what's a REPL, why should I use one, how to use it (from the IDE) and some other stuff like where to learn Clojure.

So I decided to write an introduction regarding all that (covering IntelliJ & VSCode since it's the tooling people use at work). Don't hesitate to give feedback as this surely can be improved.

Note: it doesn't cover ClojureScript but I would be glad to cover it in the same manner in another post.

16

u/bowmhoust Apr 04 '20

Very nice intro! Every language constantly needs new articles like this in order to attract newcomers. Nobody wants to deal with tooling advice from outdated articles.

1

u/frflaie Apr 04 '20

Thank you :) !

3

u/[deleted] Apr 04 '20

My first reaction after page was loaded: "click click click, then realize that nothing was selected in the first place". Links in table of contents have same blue color as selection color on my system :D

As for IDE section, I think you can safely briefly mention Cider package for Emacs. And for Vim, I think vim-fireplace is worth mentioning as well. No need to go in depth with those, both are basically plug and play type.

Well written post, was interesting read!

1

u/frflaie Apr 04 '20

Thank you for the feedback, didn't try to select, I changed some of the CSS lately and didn't test, sorry for the inconvenience :)

I'll add a brief note regarding Cider for Emacs this evening.

3

u/themariachi Apr 04 '20

Vim-iced is a much nicer experience right now than fireplace. On the topic VS and calva is def a nice intro stack

1

u/TeachUsPlz Apr 04 '20

What does it do better?

1

u/themariachi Apr 05 '20

For one the documentation is stellar. It connects to nREPL, socket REPL. Refactoring is easy and memorable eg \ref extracts the current form into its own function. It gets regular and fast updates.

Fireplace was difficult for me because the docs are (for me) a bit mysterious lol 😆 vim-iced advocates vim-plug and takes you by the hand. If you are already experienced with fireplace there's likely no reason to switch

1

u/TeachUsPlz Apr 05 '20

Thanks for the reply! I think I'll give this a try.

3

u/goldenfolding Apr 04 '20

Great article. Tooling can be tricky no matter what language you are using. In addition to this article, I'd recommend Alex Miller's Composable Tools talk, which goes into some more detail about why tools.deps exists.

I should check out VSCode + Calva and see what that does exactly. I'm using Atom and a plugin called Chlorine, and I imagine they are similar.

2

u/frflaie Apr 05 '20

Thank you for your feedback, I added the talk of Alex Miller at the end of the guide.

3

u/CoBPEZ Apr 05 '20

I should check out VSCode + Calva and see what that does exactly. I'm using Atom and a plugin called Chlorine, and I imagine they are similar.

Yes, please check out! Chlorine and Calva both bring the REPL into the editor. Chlorine does it via Socket REPL and (as of recently) nREPL, while Calva only uses nREPL, so can't be used for when there is only a Socket REPL there. But Calva also is more of a full IDE. It takes care of formatting, syntax highlighting, structural editing, and more. This makes it a bit more suitable for quickly trying Clojure out, there is very little setup needed. Install Calva and hack away. It will soon also have a debugger for Clojure.

1

u/didibus Apr 05 '20

I'd recommend you add a step for IntelliJ where you tell people to add a shortcut for the Send form before carret to REPL keymap.

I recommend setting it to either Alt + Shift + E or Ctrl + Enter.

I have no idea why there's no default binding, that's literally my most used command no matter what editor I use, but every Cursive users at my work that I tell them to add one they have a transformative experience.

2

u/frflaie Apr 05 '20

Thank you for the reply! I edited the blog post to add your idea with a screenshot.

1

u/geokon Apr 06 '20

I think it should mention that to start with Cursive you need to apply for a license.. (and why I've never bothered to try it)

2

u/frflaie Apr 06 '20

The licence is free for non commercial it takes like one minute to have one. I will explain the process in the guide :)