

A Clojure web server in (less than) 100 lines of code - icey
http://robert.zubek.net/blog/2008/04/26/clojure-web-server/

======
icey
OK, OK, so it's really a how-to use jetty from within Clojure, but it is an
excellent look into how to consume java classes from within Clojure; which
some people (like me) have a hard time envisioning from the docs on the
official site.

------
jrockway
I really like Clojure, but I have to say that the shit smell of Java still
leaks through the clean Lisp coating. _sigh_.

~~~
icey
That's really been the sticking point for me. As time goes on though, it
becomes a little less irritating. Rich Hickey has done a really great job of
managing where the language is going so far.

Initially, I didn't even want to _look_ at Clojure due to it living on the
JVM. However, this article shows that leveraging the JVM isn't entirely
terrible - sure the setup of the structures is kind of ugly, but the actual
usage doesn't look bad at all.

If you reframe it as a Java FFI instead of a language living on the JVM, it's
a little less... smelly.

~~~
brlewis
Is it too late for you to reframe this item that way? Your title suggests it's
implementing a web server in 100 lines, when really it's creating a 100-line
API for driving Java classes that implement a web server.

~~~
icey
A) You're absolutely right.

B) The title I used is the title from the blog. Aside from that, it's too late
for me to make the edit.

------
albertcardona
I have just recently created a command line utility for making clojure
scripts/plugins for ImageJ, from within ImageJ. Release details very soon at
<http://pacific.mpi-cbg.de/wiki>

Clojure is an excellent language for extending any java application and using
java libraries.

~~~
icey
I think your last sentence illustrates why guys like me (unfairly) have issues
with Clojure wrt the JVM. I don't do Java at all; I messed around with it back
in the days of 1.2 and pretty much forgot about it.

It seems like a most of the people using Clojure come from a Java background,
and most of the things being done with Clojure dip heavily into the Java
ecosystem.

Now as I said previously, I think this is an unfair assessment, from me or
from anyone else. I realize that Clojure used to also live on the CLR. It's
just that it is incredibly easy to implement the functionality from Java (and
I suppose it was this way on .Net as well), so that it feels almost like it's
loose DSL written in Java, not a full language that _just happens_ to live on
the JVM.

