Medium-size Clojure sample application?

Functional ProgrammingClojure

Functional Programming Problem Overview


Is there a medium-sized Clojure sample application that could be used as a "best-practices" example, and a good way to see what such an application would look like in terms of code and code organization? A web application would be particularly interesting to me, but most important is that the program do something commonly useful (blog, bug-tracking, CMS, for example), and not something mathematical that I've never ever had to implement in the real world (solving the N-queens problem, simulating Life, generate Fibonacci sequences, and such usual fare of function programming languages).

Thanks!

Functional Programming Solutions


Solution 1 - Functional Programming

I recommend cow-blog by Brian Carper. According to the author it was written with your purpose in mind.

Solution 2 - Functional Programming

If you browse the clojure-contrib source code you can see how libraries are implemented in clojure.

You can also checkout "ClojureScript" under the same source tree.

> Allows code written in a very small subset of Clojure to be automatically translated to JavaScript.

The ClojureScript translator is a full Clojure app.

I'd also recomend checking out the Stewart Halloway's Port of Practical Common Lisp samples to Clojure if you haven't already.

Solution 3 - Functional Programming

Take a look at Compojure. It's a web framework written in Clojure, so it allows you to write and run (on an embedded Jetty) useful web apps in Clojure, and also serves as a good example of a sizable chunk of real-world Clojure code.

It's under active development and has a helpful Google Group.

Solution 4 - Functional Programming

Check out the ants demo that is written by the author of Clojure, Rich Hickey:

http://clojure.googlegroups.com/web/ants.clj

Here's some nice instructions for getting it setup along with an emacs development environment:

http://riddell.us/clojure

Also check out Rich's presentation that goes along with this code:

http://blip.tv/file/812787

Solution 5 - Functional Programming

Clojure itself is a good example of Clojure best practices. Read towards the bottom of Core.clj, good stuff.

Solution 6 - Functional Programming

http://4clojure.com

4Clojure is an open source website where you can solve interactive fill-in-the-blank Clojure problems.

Solution 7 - Functional Programming

I think that Compojure is probably the best way to go for an example. I doubt it's a "medium sized" example, but there's probably subsections of it that are small that would work. At least, that's going to be my approach. smiles

Also, check out

http://github.com/technomancy/mire/tree/master

which is a small m.u.d. client prototype built in clojure, the advantage being that it's totally self-contained, and probably pretty simple, including the concepts involved. Documentation, eh, it's jus' alright, but the concepts in the code tie very closely to the action elements of the M.U.D. that runs easily.

Solution 8 - Functional Programming

We're two years on from this question and, whilst that's still early in the cycle for a language, Clojure is definitely being used for serious production work. At World Singles, we have several thousand lines of Clojure in production that handle all sorts of general purpose tasks in our web platform - I blogged about this in my Real World Clojure series.

For some reasonably large open source projects - not exactly applications, but high-profile infrastructure - you could look at Storm from Twitter and Cascalog from BackType (now part of Twitter). 4clojure.com has been mentioned as an open source web application, that's worth a look too, but note the new github repo for 4clojure.

Solution 9 - Functional Programming

A positive sign: there is an article on InfoQ about "one of the first published reports of Clojure being used in a large-scale production deployment." It doesn't appear to be open, but at least it is a sign of Clojure being used in a mission critical application in the real production world. A big step for the Clojure community.

Solution 10 - Functional Programming

http://code.google.com/p/lighttexteditor/

You could try light text editor

Solution 11 - Functional Programming

You can take a look here: http://bitbucket.org/kumarshantanu/blogjure/overview/

It is a tiny blog application written using Hibernate, Compojure and StringTemplate that actually works!

Solution 12 - Functional Programming

I can only recommend you to check out Pedestal, a very promising web framework, both server-side and client-side (where it facilitates ClojureScript). The gui stuff is a bit hard to grasp, but quite much the way it should be done to stay sane in a large app.

Solution 13 - Functional Programming

edge is a moderately sized application showcasing structuring an application with Clojure, ClojureScript, Component, Yada, Aero, and Boot.

Solution 14 - Functional Programming

Clojure is still too young and a moving target to have medium sized applications with available source code yet.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfoxdonutView Question on Stackoverflow
Solution 1 - Functional ProgrammingmacView Answer on Stackoverflow
Solution 2 - Functional ProgrammingBrian GianforcaroView Answer on Stackoverflow
Solution 3 - Functional ProgrammingChristian BergView Answer on Stackoverflow
Solution 4 - Functional Programmingpjb3View Answer on Stackoverflow
Solution 5 - Functional ProgrammingRayneView Answer on Stackoverflow
Solution 6 - Functional ProgrammingdbyrneView Answer on Stackoverflow
Solution 7 - Functional ProgrammingKzqaiView Answer on Stackoverflow
Solution 8 - Functional ProgrammingSean CorfieldView Answer on Stackoverflow
Solution 9 - Functional ProgrammingJim AndersonView Answer on Stackoverflow
Solution 10 - Functional ProgrammingBerlin BrownView Answer on Stackoverflow
Solution 11 - Functional ProgrammingShantanu KumarView Answer on Stackoverflow
Solution 12 - Functional ProgrammingclajView Answer on Stackoverflow
Solution 13 - Functional ProgrammingDaniel ComptonView Answer on Stackoverflow
Solution 14 - Functional ProgrammingMarkoView Answer on Stackoverflow