Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Getting Started with Clojure Guides (assembla.com)
53 points by fogus on April 7, 2010 | hide | past | favorite | 19 comments


EDIT: Clojure is easy to get up and running with! This was written before I got some excellent feedback in the comments below. Apparently I've been following an out-of-date Clojure tutorial.

I just got Halloway's book, and I have to say, getting started with Clojure isn't as seamless as it could be. I mainly want to write web-apps with it, so I thought I'd get going writing an app using compojure. Well, it turns out that I to do that I need:

1. Java 2. Clojure 3. Clojure-contrib 4. Ant 5. Maven 6. Leiningen

And there's no equivalent of CPAN or gem to fetch all this for me, IMHO, a huge pain in the ass, doubly so because a lot of this stuff involved mucking around with env vars like JAVA_HOME and CLASS_PATH. Is there an easier way to set this up than just downloading the individual packages? Something like WAMP for Clojure? I'm not looking forward to going through this again.

By comparison, in ruby I could just: 1. Download the ruby installer (Windows)/ apt-get install ruby-full (Ubuntu Linux) 2. gem install sinatra

And you're done.


It should be much simpler than that. Leiningen has a "lein self-install" command that downloads all the basic dependencies. See here: http://www.assembla.com/wiki/show/clojure/Getting_Started_wi...

Once Leiningen is installed, dependencies are handled automatically. You can use "lein new my-project" to create a new project skeleton, and then customize the project.clj file to add in new dependencies. Most Clojure projects are now up on clojars.org, which is one of the repositories included by default in Leiningen.


You're right, I was acting on some mistaken premises, I'm up and running now, thanks for the tip.


I helped a friend get up and running with clojure this weekend. It's pretty simple with leiningen, just add swank, elpa and one is good to go! Of course I've wasted inumerable hours myself in the past trying to get it to work in the past but now I think it easily just works without much tweaking. We set it up two good on two OSX machines in just 20 minutes each.

It would be nice though to just build a little ruby gem with the lein binary. "gem install leiningen" but that would be violating the language barriers :)


Have you tried this...

http://mmcgrana.github.com/2010/03/clojure-web-development-r...

All you need is leiningen and your favorite text editor.


You're right, I have to take most of that back, that was mostly my frustration trying to install it on Arch linux, which has no Java packages. Additionally, I was following an apparently out of date tutorial that said I needed all that other stuff. On Ubuntu, I just gave it a shot, and it's much easier.

apt-get install clojure maven2

Followed by downloading the leiningen self installer works just fine.

Thanks for the link btw!


This tutorial has good install instructions for clojure+compojure+enlive using only Leiningen (and git):

http://github.com/swannodette/enlive-tutorial


You don't even need to install Clojure and Maven, I don't think. Leiningen downloads the relevant Clojure and Maven jar files as part of its install process.


Not a problem. You don't even need to install clojure or maven, Leiningen takes care of all that.


I have a template that I have been using to get started that I wrote up (http://blog.markwatson.com/2010/04/my-clojure-ring-compojure...)

I wanted to have a template for Compojure+Ring, etc. I am creating a second template that uses congomongo + MongoDB as the backend datastore.


This is great, nicely done.


> Apparently I've been following an out-of-date Clojure tutorial.

There's a _lot_ of out-of-date docs out there. This is probably the #1 hurdle newcomers face getting started with Clojure and Emacs at least. That's why this Getting Started wiki page is so important; it gathers it in one place where out-of-date stuff can be fixed collaboratively.


This might not be related to Clojure guides... but I'd like to know what you guys think about various Clojure books out there... (Manning, Apress, PragProg).


I have three - "Programming Clojure" (PragProg), "The Joy of Clojure" (MEAP - Manning) and "Clojure In Action" (MEAP - Manning). There is the Apress book coming out soon, and I am yet to pick up the beta

Of those 3 the PragProg and "Clojure In Action" seem to be the ones that most people are using to get up and running with Clojure. The PragProg is pre 1.0 (FYI).

Both the above mentioned books look good. But I am especially impressed with the Joy Of Clojure by fogus (a HN'er) - From what I have read so far (which is the first 4 chapters in the MEAP) - they are taking a different approach to teaching Clojure. They are emphasizing the philosophy of Clojure - so they attempt to explain the "why" as well as the "how". Having played with some Clojure this definitely helps to bring somethings into perspective.

I would recommend picking up the PragProg book (if for no other reason than it's the only complete Clojure book out there) and "The Joy of Clojure". I am eagerly waiting out the Apress book to see how it is.

Hope that helped.


Thank you very much!


If you want to learn Clojure, buy "Programming Clojure" (the pragprog book).

The EAP for "Joy of Clojure" has been pretty good; it will probably also be a must-have.

I haven't heard much of anything about the Apress book, so I can't comment on that. Luke Vander Hart is a pretty smart dude, so it has a chance of also being a good book.


Apress hasn't updated the listing in a while, but Stuart Sierra is actually the co-author on that, too.


I saw his tweet mentioning it and thought maybe there was a second mystery book coming. This makes much more sense!

http://twitter.com/stuartsierra/status/11484474610


Manning sends out discount/promotional codes for MEAP's pretty often:

http://manning.com/free/dotd.html

Or, you can google for them, they're usually 25-35% off




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

Search: