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