Hacker News new | comments | show | ask | jobs | submit login
The Newbie’s Guide to Learning Clojure (elangocheran.com)
86 points by fogus on Apr 9, 2012 | hide | past | web | favorite | 14 comments

Well, the site won't load for me, but so long as we're on the topic of clojure newbie stuff, I just put together a simple project on github to demonstrate lazy-evaluation for those new to clojure by visualizing elementary cellular automata. I tried to annotate the source quite heavily to make it clear what's going on.

It can be found here: https://github.com/andrewvc/clj-automata

Sorry for the site loading so slow. I submitted this a week ago and thought it got ignored into Hacker News oblivion. Back then, I added a cache plugin, but I guess that's not enough.

I woke up this morning surprised to see it's on the front page a.t.m. I'm going to troublehshoot right now.

I also have the dirt-cheap lowest VPS option on Rackspace -- is that the problem? If anybody has immediate ideas on how to make my server not be so slow, pass them along (and thanks for reading!)

If you want performance on a low end VPS you could use a static website generator like Jekyll, Hyde, nanoc etc ...

... aaand we're back, with more RAM. Thanks, great suggestions, will try them out!


I was having trouble getting reception, here is the Google cache if others are in a similar situation.

same here, why dont people just use github or other usefull hosting for their blogs :-/

I think the site load time is an allegory for how long it takes for the JVM to start up.

There are some good links in this blog. If you are a Clojure newbie, definitely check out the text-only cache of this blog.

I also want to note that "Clojure newbie" has many meanings, depending on which direction you approach Clojure from. Depending on whether you come from Java, LISP, Python or nothing, you will start with different tracks. I would recommend that Java programmers actually start with protocols and reify, typically billed as advanced subjects, then the concurrency primitives, before getting into macros and advanced LISP stuff.

What do you suggest for a 'nothing' category?

By 'nothing' I mean that I'm a sysadmin, knows a smattering of PERL, a little BASH, a lot of this and that over the years.

In my life, I've learned and used the following languages, in this order: Logo, Basic, Pascal, C++, Java, Python, Ruby, Clojure. Each time that I learned the next language, I thought it was a great improvement on the previous, and I wondered what I had been spending my life doing with the previous language.

My experience is that with Clojure is a testament to pretty much everything in "Beating the Averages" (http://www.paulgraham.com/avg.html) It's hard to know for sure, but I have a feeling that I will end up using Clojure far much longer than the rest of those languages, combined.

If you are contemplating learning a language for one-off commands and sysadmin scripts, then I kind of prefer Ruby over Python and Perl for expressiveness and readability. Most Rubyists are of the Rails persuasion, but I still have never learned Rails.

I came to Lisp via "The Little Schemer", and I recommend it for people who are new to Lisp (and/or programming). It's short and sweet, but explores some really interesting and deep ideas (recursion, higher order functions, the Y combinator, the halting problem, and interpreters). I like to think of it as "SICP lite".

It won't teach you Clojure, but it will open your eyes and set you on a path to Clojure, and I think give you a very strong grounding for Lisp. At least that's what I think it gave me.

On the other hand, if you really want to get up to speed on Clojure specifically, Rich Hickey's talk "Clojure for Java programmers" is a great intro to the language. I don't think you need Java experience to get something out of it, it's mostly targeted at non-Lispers without much functional programming experience.


If you can wait til Apr 22 (by Amazon's release dates), there will be 2 more clojure books which I'm pretty confident will be excellent, in addition to 2 Manning books which are also great.


And you want to spend quality time in the REPL.

Have you ever taken a look at Higher Order Perl? It's an introduction to Functional Programming in Perl.


This interview with the author covers the point of the book (which is to help Perl programmers to learn non-procedural programming):


hehe. the load time is more like the stunned expression you get when you realize people picked up on something you said. :-P (I should have an upgraded amt of RAM in a matter of minutes, and hopefully it'll be up again.)

Interesting recommendation for Java programmers. I've noticed a lot of people smiling instinctively when they see the Seesaw project. Seesaw turns Java Swing GUI programming from a horror into a pleasure, so that's another idea.

About Seesaw, the GUI for the Clojure namespace browser was whipped up by Frank in the course of 1 week (https://github.com/franks42/clj-ns-browser). As Frank puts it, it's a testament to Seesaw, since he had no real experience in Java Swing, and he got the GUI working from the couple of hours a night he got each day after he put his kids to sleep in that one week.

I would also add that a newbie should check out clojure-koans (https://github.com/functional-koans/clojure-koans#readme) and try to solve some of the Project Euler problems (http://projecteuler.net/problems). Both of these have been great resources for me to get the basics of the language.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact