News for hackers. Stuff that matters.
Re:Clojure's Webframework "Noir" hits 1.2.0 by learc83 on Sunday October 02, 2011 @05:15PM (#3064038)
What is generally accepted as the most popular clojure web framework? I'm new to clojure, and functional languages in general, so I'm actually starting with working through SICP before I look into a framework, but I'm curious.

tl;dr What is the equivalent of rails in the clojure community?

Re:Clojure's Webframework "Noir" hits 1.2.0 by brehaut on Sunday October 02, 2011 @05:30PM (#3064086)
There is no one framework (in fact, most of clj's web ecosystem is not frameworks) that is far and away more popular than the others.

At the heart of everything is Ring[1]. Ring is roughly equivalent to WSGI or Rack. However, if you use Django in python you basicly dont ever have to know about WSGI. In Clojure you do want to know about Ring. Thankfully Ring is very simple; its a spec describing request maps and response maps. In addition provides common adapters for various JVM web servers (In the general ring ecosystem there is support for Jetty, Netty (via Aleph/Lamina), Google App Engine (via appengine magic), Servlets, Mongrel2) and middlewares.

There are three sets of libraries on top of ring that are commonly used to build sites:

## Moustache

Probably the closest to raw ring of the three, moustache provides a sophisticated url routing API. Of the three I'm mentioning here it is probably the least suitable for clojure beginners, however it is my personal favorite.

## Compojure

This was the most popular [noir is apparently on par] and oldest (it predates ring but was rewritten ontop of it in the 0.4.0 release). The best analogy here is apparently sinatra for ruby.

## Noir

Noir is the most recent addition and is higher level than Moustache or Compojure. In fact, Noir is built on Compojure. I havent had any real experience with Noir myself but it is probably the easiest entry point into web programming in clj.

Compojure and Noir both use Hiccup for HTML generation, and Moustache uses Enlive. Enlive is extremely powerful; even if you choose hiccup I would encourage you to take a good look at enlive anyway, the two solutions dont need to be mutually exclusive.

  [1] Ring: http://github.com/mmcgrana/ring/
Re:Clojure's Webframework "Noir" hits 1.2.0 by brehaut on Sunday October 02, 2011 @05:43PM (#3064128)
It would be remiss to not point out that noir probably has the strongest set of documentation (both api and tutorial styles) of the main three libs.
Re:Clojure's Webframework "Noir" hits 1.2.0 by frou_dh on Sunday October 02, 2011 @05:25PM (#3064073)
This article is the motherlode:

http://brehaut.net/blog/2011/ring_introduction

Re:Clojure's Webframework "Noir" hits 1.2.0 by thmzlt on Sunday October 02, 2011 @05:21PM (#3064059)
I don't think there's an equivalent framework (fortunately), but there is Compojure (https://github.com/weavejester/compojure) which is similar to Sinatra.
Re:Clojure's Webframework "Noir" hits 1.2.0 by ibdknox on Sunday October 02, 2011 @05:26PM (#3064075)
I'm biased, so take everything I say with a grain of salt :)

I'm not sure there is a rails really and I think that's somewhat by design. Compojure is probably the most famous Clojure web lib, but it's not a framework per se. It's at a level below web-frameworks as most people think of them and Noir is actually built on top of it.

If you're just wondering in terms of having an active community, I believe Noir is currently the most trafficked complete package, but Compojure itself draws a lot of discussion :)

Re:Clojure's Webframework "Noir" hits 1.2.0 by gcv on Sunday October 02, 2011 @09:19PM (#3064601)
Others have mentioned Compojure, Moustache, and Noir. There's also Conjure (https://github.com/macourtney/Conjure), which tries to operate at a higher level, and has been around for quite some time.
Re:Clojure's Webframework "Noir" hits 1.2.0 by chc on Sunday October 02, 2011 @05:32PM (#3064097)
Clojure doesn't quite have "the equivalent of Rails" yet. Ring is basically equivalent to Rack, Compojure is a lot like Sinatra, and Noir is sort of like Merb, except it's built on top of Compojure.
Re:Clojure's Webframework "Noir" hits 1.2.0 by vdm on Sunday October 02, 2011 @09:41PM (#3064655)
ringfinger is the closest thing I have seen to rails.

https://github.com/myfreeweb/ringfinger

Re:Clojure's Webframework "Noir" hits 1.2.0 by vdm on Sunday October 02, 2011 @05:27PM (#3064080)
> What is generally accepted as the most popular clojure web framework

Citation needed.

Re:Clojure's Webframework "Noir" hits 1.2.0 by ibdknox on Sunday October 02, 2011 @05:28PM (#3064083)
I think he meant it as a question, not a statement.
Re:Clojure's Webframework "Noir" hits 1.2.0 by vdm on Sunday October 02, 2011 @06:42PM (#3064271)
My bad, I didn't see the ?
Re:Clojure's Webframework "Noir" hits 1.2.0 by ibdknox on Sunday October 02, 2011 @06:43PM (#3064276)
It wasn't there. Came in as an edit.
Re:Clojure's Webframework "Noir" hits 1.2.0 by learc83 on Sunday October 02, 2011 @07:55PM (#3064457)
Yeah, I edited after I saw the confusion.