Ask HN: Getting started with Clojure

40 points by chaosprophet ↗ HN
Hi all, I recently decided to start learning Lisp, and after some very unscientific research decided on Clojure. I'd like to know about some good resources to start learning clojure. I come from a mostly C background.

Also, I don't believe in starting small and then gradually writing more complex programs, I usually just do a small Hello World and then jump directly into a decently complex program, and I'd like to do the same with clojure. Is this a good approach to clojure?

Ideally, I'd like to get started with a small GUI program.

Regards, chaosprophet

Edit: I don't know anything about functional programming either.

20 comments

[ 3.3 ms ] story [ 31.3 ms ] thread
I want to get started in Clojure too. Rich Hickey's talks on InfoQ have been making me feel kind of funny... like when we used to climb the ropes in gym class.

But seriously, yeah I'd love to find a project to play with its concurrency features and learn some gui as well.

It's kinda like the firehose drink, the language and compiler are changing rapidly, but I think what's described in Stuart Halloway's (excellent) book is still applicable, except for some very small number of bugfixes and breaking changes in 1.1 and 1.2. The next release of Fogus/Houser's draft "Joy of Clojure" book should be butt-kicking, don't know when that's scheduled tho.

Also, installing swank, slime and paredit, and getting one/more of leiningen/ant/maven to work seem to consume a lot of bandwidth (this might be one of the times that the MS windows install is more straightforward).

just saw this for Debian:

http://measuringmeasures.blogspot.com/2010/01/my-new-clojure...

the IRC and google group are very friendly, ask questions!

Thanks, I was thinking of using Qt, but I'll look into the others too.
If you want to proceed quickly from Hello World to a complex application, I suggest looking at Eclipse RCP, which uses SWT. Whether it is suitable will depend on what kind of app you want to build. Here's a list (with screenshots) of open-source apps that use Eclipse RCP:

http://www.eclipse.org/community/rcpos.php

It's a big help if you have a baseline ability to read Java, as it's likely the example code for libraries you'll want to use is in Java. You don't need to be able to create a baroque class hierarchy yourself as long as you can navigate one well enough to figure out the library calls you need to use.

Clojure is a fairly gentile introduction to functional programming, I think. You can do imperative-style things with the reference types, so you don't need to completely learn how to structure the logic of a program.

I'm fairly decent with Java, so I guess working with java libraries shouldn't be a problem.
I strongly recommend Stuart Halloway's book, Programming Clojure.

http://pragprog.com/titles/shcloj/programming-clojure

Mark Volkmann also wrote a pretty good article:

http://java.ociweb.com/mark/clojure/article.html

Stop by the Google group with ANY questions. No question is too silly. We're all dying to help.

http://groups.google.com/group/clojure

Once you get the basics down, and you don't mind some shameless self promotion...

http://vimeo.com/channels/fulldisclojure

SFD

Don't forget #clojure on freenode. I've lost count of the number of stupid questions I've had answered there. Rich Hickey is active on the channel and may even be the one to answer your questions.
Thanks, I've already put out an order for Programming Clojure. I'm going through the Mark Volkman article now.
That's what I did to learn Clojure.

The only problem with starting off doing GUI is that you will be in javadoc hell learning swing (or whatever) at the same time as Clojure. But it is nice having GUI essentially baked into the language.

I found this comment to be most helpful:

http://news.ycombinator.com/item?id=1033503

that's not a comment that's the Iliad and Odyssey of cloj tutorials
More of a meta-tutorial, but thanks! I've never been compared to Homer before....

I just reviewed it and it's still current, there are no new video venues that I know of and the next Clojure books are still in progress.

"I've never been compared to Homer before...."

I have, but it involved the word "Doh!" :)

Thanks for the extra-informative post; it makes poking around Clojure less daunting.

Wow, that's really thorough. Thanks for digging it up, I didn't find it in my own search of HN.
Setting up IntelliJ (version 9, either free open soirce version or commercial version)with the Clojure plugin was a good start for me. I bought Stuart's book (physical book) and the other two Closure books as work in progress PDFs - good references and a help to write idiomatic Clojure code.

BTW, IntelliJ free version also works well with the Scala plugin, so you can mix Java+Clojure+Scala in one project. With the commercial version, you can add JRuby to the mix.

Why on earth would you want to build a website using four different languages?

Isn't the fact that you always get HTML+CSS and JavaScript tossed in for free enough of a nightmare?

A fair question: I am writing a utility in Java, but I wanted to supply idiomatic wrappers for JRuby, Scala, and Clojure.