Robert Zubek: Clojure webserver in sub-hundred LOC
Robert Zubek wrote a blogpost on how to write a webserver in Clojure in less than 100 lines of code. Interestingly, he uses Jetty for the actual serving part — interesting because Clojure has an excellent bridge to Java (as it runs on the JVM itself.)
It’s nice to see how you can tie in a Lisp-1 with something as shoddy and sordid as Java itself, and still keep it somewhat elegant.
You have to admit this is darn cute:
user=> (import '(org.mortbay.jetty Server))
nil
user=> (new Server)
Server@1f0f8ff
user=>
Shoddy and sordid, even! Man, you’re really bringing the hate here… ;)