addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: Clojure Installation and Deployment

From: Martin B.
Sent on: Wednesday, September 8, 2010 11:07 AM
> The hard part of all the Lisps, and the reason they fell
> out of popularity/never gained traction, is simply that
> install/deploy/using­ the libraries was too difficult and
> frustrating.
> Right now, for example, I am trying to program Clojure on
> Android and use Java libraries to reimplement a code
> example from a Java book in Clojure.
> I am spending half my day at least messing around with
> configuring eclipse.ini to point at JDK instead of JRE and
> trying to write anything in Clojure that runs on Android
> and finding out that Clojure for Android is buggy and
> possibly only works on Linux, etc.
> I also wanted to use Clojure with CouchDB and couldn't
> figure out how to install the clojure-couchdb libraries
> from disclojure.
> Programmers hate the feeling of wasting time on things
> that aren't programming.
> In Ruby or Python, everything just runs out of the box,
> seamlessly integrated with braindead 1 click installers.
> You go straight from concept to code.
> Ruby has Rubygems, Perl has CPAN, Haskell has
> Hackage/Cabal where you can easily download libraries and
> install them hassle free, Python libraries similarly easy
> to install.
> Clojure has not reached that level of ease of use for
> install and deploy to my knowledge -- if it has please
> share.
> I'm unaware of a similar automated installer that works
> seamlessly and did not find download and install to be
> straightforward.
> It's possible that the reason you have so few speakers is
> because everyone is embarrassed to say they'd love to
> learn the language but they don't know how to install the
> damn thing.
> It's also entirely possible I'm the village idiot and the
> only person struggling with this, so I speak for myself.

You are not, and I'm certain other people agree with your

I also have found I had to spend way more time than I wanted
to figure out how to set it up to work properly and deal
with the various quirks. Part of this "problem" is that for
those of us who haven't had a whole lot of Java exposure you
get double the quirks in the installation process:
Clojure's, and Java's. I have had to find answers by asking
dumb questions on the IRC channel, which has been very
useful to me (people on the channel are quite forthcoming
with newbie answers and very nice generally, and clojurebot
is so useful!). Moreover, some Clojure discussions online
assume you already know the products of the Java ecology
(e.g. Maven) and this can be frustrating, it adds to the
learning curve the learning of libraries that you will use
sometimes only superficially, and it ends up exposing you to
more Java stuff than you'd otherwise want to.

  (On another account, I've been quite surprised to find
  that even people who have had a lot of Java experience
  have often been entirely shielded from the details of
  running Java programs because of Eclipse and other
  automated deployment tools. For _some_ of them you take
  away Eclipse and they don't know where to run.)

Somebody ought to write a HOWTO to make this easier, but
things are changing quite fast, and new tools appear all the
time (plus that kind of writing is not necessarily
rewarding). But it _would_ help a lot of people though, I'm

Here's what I would include in this HOWTO:

- Basic basic intro to Java, the JVM and Jar files, and how
  to start Java programs from the cmdline, with a special
  focus on the quirks of the runtime environment (e.g. no
  CWD), how Java selects its main program to run, etc..
  Assume no prior Java knowledge.

- Simple invocation: trivial invocation of Clojure to get a
  REPL by invoking Java directly. (This is a one-liner.)

- Invocation of a more complex existing program: how to
  start a Clojure program "manually", that is, you still
  invoke java directly, but this time providing an explicit
  list of jar files including third-party libraries, in the
  '-cp' option, to start an existing program and run a
  function (no REPL).

    (BTW writing a little sh script for a specific program
    is my favourite "sure fire" way of starting Clojure,
    where you have full control over the entire environment
    the JVM get and it "just always works". Maybe there's a
    better way? I don't know.)

- gen-class: I have found discussions on gen-class and how
  it works thoroughly confusing until I understood where it
  came from (by asking more dumb questions at the meetup).
  The background and context around gen-class deserves some
  non-trivial amount of explanation, where it puts its
  files, how they're found, what they contain, etc.

- Compiling: how to compile and package a Clojure program
  into a jar file.

- Editor support: using Emacs & swank-clojure to get a REPL
  experience for interactive development. There are quite a
  few quirks worth mentioning there.

  - Using `deftest` for running from Emacs.

- Other tools: Netbeans, Eclipse, etc.

- Leiningen: what Leiningen does, how it does it, where it
  puts its downloaded files, and how to use it (basics). A
  minimal explanation of Maven basics could be inserted
  here. A big warning about downloads on slow connections
  (it downloads a lot of stuff in the background).

Even better would be to make Clojure as easy to run as
Python/Perl/Ruby, etc, so you don't even have to know any of
the above in order to run code.

Since you're in a peculiar environment (Android), I would
try starting Clojure "manually", by invoking java with all
the jars you need + the clojure and clojure-contrib jars.
Write a shell script. Once you get your full list of jars
pinned down in the script, this should always work.

> Also, regular expressions for Clojure is documented
> extremely poorly, or perhaps it is file access -- I write
> a lot of programs that involve scraping data out of text
> files (doesn't everyone?) and did not find this to be easy
> in Clojure.
> I'm fascinated by all the new functional languages, but in
> my opinion many of them seem to be like politicians --
> they promise much and deliver very little.

They do deliver a lot to those who pay the price of
admission (I've been rewriting some Python code in Clojure
and seeing a >5x reduction in LOC, and it runs a lot
faster). I think your point is that the price of admission
should be made a lot lower, and frankly I don't see any
_technical_ reason why it couldn't.

BTW, if you want a LISP packaged a bit more like Python/Ruby
and which "just works" out of the box and it lightweight,
you might want to have a quick look at Racket (PLT Scheme):


Startup time is inexistent, so you can write short
command-line scripts with it, and no funny stuff to get it
started, it's as you'd expect:

  racket  MYPROGRAM.rkt

...and it just runs.

(BTW even when you have the equivalent setup for Clojure, a
Java JVM starting up will lock up and freeze your computer
for several seconds, so it still won't be practical for
small/quick scripts.)

> Then I can get up in front of the group and say something
> intelligent.

You just have.


Our Sponsors

  • Intent Media

    Intent Media hosts Clojure NYC and provides food and drink.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy