Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure website libraries and tutorials

Tags:

clojure

web

I want to build a website using Clojure...so: 1) which are the best libraries out there to do this at this time (summer 2011) 2) where are the best tutorials showing more than just a basic static "Hello World" webpage?

like image 497
Alistair Collins Avatar asked Jun 23 '11 05:06

Alistair Collins


People also ask

Is Clojure good for web development?

Yes, Clojure is great for web development. Here are the main reasons: JVM deployment options. Clojure can deploy anywhere Java can.

What is Clojure library?

Clojure is an umbrella level project that hosts many additional libraries called Clojure contrib, which all exist under the Clojure organization on GitHub.

What is luminus Clojure?

Luminus is a Clojure micro-framework based on a set of lightweight libraries. It aims to provide a robust, scalable, and easy to use platform. With Luminus you can focus on developing your app the way you want without any distractions.


7 Answers

There's a web framework called Compojure you might look at. I've never used it personally, but this blog (by a frequent stack overflow contributer) seemed to have been written using it.

like image 149
jk. Avatar answered Oct 05 '22 17:10

jk.


The key library to learn and understand is Ring. Ring is the basis for all of the web "frameworks" in the Clojure toolkit, the most well-known being Compojure, Moustache, and Conjure.

Per the Ring readme, Ring "abstracts HTTP to allow modular and concise webapps". Translation: Ring lets you deal with HTTP requests and responses as simple Clojure maps and allows you to apply "middlewares" (functions that do things to those request/response maps) to add extra functionality like session handling, URL parameter handling, cookie handling, etc.

If you don't understand Ring, you won't understand what the other libraries do for you.

At the most basic level, Compojure and Moustache provide conveniences on top of Ring, specifically route handling and easier application of middleware functions. Beyond that, Compojure comes packed with a lot, while Moustache is more minimal framework. Conjure is a more Rails-like, full-blown framework that handles web app development at a similar level of abstraction as Rails (pre-built MVC architecture, schema help, etc.).

For a good overview of all the libraries in the Clojure web space, see this graphic: http://www.glenstampoultzis.net/blog/wp-content/uploads/2010/10/web-layers7.png

There's a lot there. At this point, folks seem to be bringing smaller libraries together as needed to write web apps, instead of relying on one bulky "killer" web framework that tries to be all things to all people.

like image 25
semperos Avatar answered Oct 05 '22 17:10

semperos


1) imho the best (the most mentioned and elaborated) is Compojure + Ring

2) tutorials: simple: "Getting Started with Ring and Compojure" http://rob-rowe.blogspot.com/2011/03/getting-started-with-ring-and-compojure.html

more complex: "Building a Social Media site" http://www.bestinclass.dk/index.clj/2011/01/building-a-social-media-site.html

like image 44
zmila Avatar answered Oct 05 '22 17:10

zmila


Noir is a Clojure web framework that's been released recently.

like image 40
Susheel Javadi Avatar answered Oct 05 '22 15:10

Susheel Javadi


Check out "A brief overview of the Clojure web stack", which is a wonderful guide to the current state of web-related Clojure libraries.

like image 43
sanityinc Avatar answered Oct 05 '22 17:10

sanityinc


I recently switched from

(+ Clojure ring compojure hickup google-app-engine)

to

(+ clojure ring compojure enlive heroku)

like image 42
Arthur Ulfeldt Avatar answered Oct 05 '22 15:10

Arthur Ulfeldt


  1. Intro to Clojure is one the video tutorials
  2. http://blip.tv/clojure has some screen casts, which will be helpful for you
  3. Learn Clojure
  4. http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html
like image 40
gmhk Avatar answered Oct 05 '22 16:10

gmhk