9 Replies - 13961 Views - Last Post: 01 October 2011 - 08:22 AM

#1 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Clojure Resources Thread

Posted 10 May 2010 - 11:39 AM

Clojure is a fairly new language. It's a modern Lisp, hosted on the JVM. It's focused towards functional programming, but it isn't a purely functional language like Haskell. It offers polymorphism through powerful multimethods and protocols. It gives you the best parts of OOP without the bad.

The language was started in 2007. Between then and now, the language has gained tons of recognition and a massive and extremely fast growing community. The speed at which the community has gone together and the language has become production ready is well due to the fact that Clojure can leverage any existing Java library and Java codebases. This cut out the need for libraries that most languages suffer from in the beginning.

Clojure is well on it's way to becoming a household (a coder's house, obviously) name.


Editors and Build tools

Clojure people use a whole string of different editors, mostly depending on their background, be it Java, Common Lisp, or C.

There is a set of guides to getting setup with Clojure and various tools and editors on the Confluence wiki: http://dev.clojure.o...Getting+Started

Common editors include Emacs, Vim, Eclipse, IntelliJ IDEA, and Enclojure.

While the IDE support is okay and getting better, most Clojurists like to use Emacs. Emacs is arguably the most powerful editor in existence. It's far more than just an editor, and it itself is mostly written in a custom dialect of Lisp, called elisp, which is a huge plus for Lispers, because you can use elisp to configure Emacs to do anything.

While Emac is the most popular editor, a lot of people still use Vim for Clojure. And why shouldn't they? It too is an excellent editor and has external support for Clojure via VimClojure. The above link has a page about that. The only thing I'd like to add is that you should probably use the bitbucket repository for the most up-to-date support.

As far as IDE support goes, at the time of this edit, it appears that Counterclockwise and La Clojure are the most heavily developed, in that order. IntelliJ IDEA is free now, so La Clojure is a viable option for everybody. Counterclockwise is a very viable option, and is probably the most heavy developed.

Since Clojure is on the JVM, pretty much all Java build tools work for Clojure, including Maven and Ant. There are even some build tools built specifically for Clojure with simplicity in mind for people who are too afraid of Maven (like pretty much everybody, including myself).

Common build tools are cake and leiningen. The first thing you should do when you get started with Clojure is install cake or leiningen. Don't try to 'install' Clojure. Just use cake or leiningen to get an REPL and manage your project, because that's the closest you'll get to 'installing' Clojure like you would Python or Java. All Clojure is is a jar file. Instructions for installing either of these build tools are on the dev.clojure.org link I linked above.

Leiningen is the most popular build tool and has been around for a while. Cake adds some capabilities and I use it personally, partially because my company develops it and partially because the rest of our projects depend on special features it provides. Both are actively developed and they both have the same basic features that you need, so I (nor anybody else) cares which you choose. Just choose one. ;)


Learning Clojure

This is the fun stuff. You're all set up and ready to fire off some Clojure code, but you have to learn the language first!

First off, is the wonderful and free tutorial that lots of people start out with: Clojure - Functional Programming for the JVM. This is a good (outdated) tutorial on Clojure that might be helpful for getting you going before you're ready to buy a book.

Beyond that, there are several books published and even more in the making. There is Programming Clojure, which is already published. It's quite a bit outdated though, so I don't recommend it. There is a 2nd edition coming out soon.

A more up-to-date book is Practical Clojure which essentially serves the same purpose as Programming Clojure does, but for the newer versions of Clojure.

The most important book of them all is: Joy of Clojure, which is the book on Clojure.

Other books are in the works including Chas Emerick's Clojure Programming and my own book. The electronic version of my book will be free once it is complete. I'll be sure to highly publicize it here on DiC so that you can all get in on it.

Getting Help

The Clojure community is extremely active and newbie friendly. By far, the quickest and most one-on-one place to get help with anything Clojure is the #clojure IRC channel on the popular Freenode IRC network. Well over 300 people frequent that channel, and the most important people people in the community hang out there as well, including the core Clojure development team.

A less direct, but equally effective means of getting help is the Clojure maling list via Google Groups.

Those are the primary community-centered ways of getting help. There is also HERE! and places like stackoverflow.com. Admittedly, there aren't tons of Clojure programmers on this site, but there are a few, and we will try to help you to the best of our abilities and as fast as possible right here on DiC, so don't be afraid to ask questions.


Miscellaneous

Are you afraid of parens? Don't understand why Lisp has them? Read this: http://www.defmacro....lings/lisp.html

Want to try Clojure right now without installing it? Check out my TryClojure site: http://try-clojure.org, it's an online REPL written in Clojure.

Clojure has it's own reddit.

Are We There Yet: A presentation by Rich Hickey, not really related to Clojure, but is important in general.

Persistent Data Structures and Managed References: A presentation by Rich Hickey


There is a huge amount of information about Clojure right on the Clojure website. Here are a few links that should help you out if you're wondering why I lubs me some Clojure:

Clojure Rationale, this is a very important page to read, and will give you some inklings into why Clojure is designed the way it is.

Clojure Feature Page, a list of a few key features that make Clojure awesome.


If you have anything to add, post below.

This post has been edited by Raynes: 01 October 2011 - 08:22 AM
Reason for edit:: Updates


Is This A Good Question/Topic? 4
  • +

Replies To: Clojure Resources Thread

#2 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: Clojure Resources Thread

Posted 12 May 2010 - 01:18 PM

Thanks for posting this Raynes. I've never heard of Clojure before and it sounds intriguing. But, aside from the ability to write self-modifying code, what else do you see as the appeal of this language?

Also, can you offer any reasons for preferring Clojure over other languages such as CLOS or OCaml? I understand that many libraries -- such as GSL, LAPACK, BLAS, and others -- support both CLOS and OCaml, and both have been around much longer and presumably have much larger userbases. So why so much enthusiasm about Clojure? Is it simply its integration with Java that appeals to you, or something else?
Was This Post Helpful? 1
  • +
  • -

#3 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Clojure Resources Thread

Posted 12 May 2010 - 05:23 PM

View Postr.stiltskin, on 12 May 2010 - 04:18 PM, said:

Thanks for posting this Raynes. I've never heard of Clojure before and it sounds intriguing. But, aside from the ability to write self-modifying code, what else do you see as the appeal of this language?


Besides the numerous benefits you get from using a Lisp, Clojure allows an easy way to access the massive Java library, both built in and third party. The fact that it runs on the JVM also means that it is a write once, run everywhere platform.

Clojure is functional, allowing it to be easily written concurrently.

If you have some time, check out (one of) Rich's presentations here http://www.infoq.com.../hickey-clojure

:)

edit: ignore my post, read what Raynes said :P

This post has been edited by erik.price: 12 May 2010 - 06:06 PM

Was This Post Helpful? 1
  • +
  • -

#4 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Clojure Resources Thread

Posted 12 May 2010 - 06:04 PM

View Postr.stiltskin, on 12 May 2010 - 12:18 PM, said:

Thanks for posting this Raynes. I've never heard of Clojure before and it sounds intriguing. But, aside from the ability to write self-modifying code, what else do you see as the appeal of this language?

Also, can you offer any reasons for preferring Clojure over other languages such as CLOS or OCaml? I understand that many libraries -- such as GSL, LAPACK, BLAS, and others -- support both CLOS and OCaml, and both have been around much longer and presumably have much larger userbases. So why so much enthusiasm about Clojure? Is it simply its integration with Java that appeals to you, or something else?


The ability to write self-modifying code (a la macros) is enough of a reason to prefer Lisp (not just Clojure) over other languages in itself. It's absolutely amazing. But I'll try to explain my enthusiasm.

CLOS is an object system (one of the most powerful object systems in existence, if not the most powerful) written for Common Lisp. The language you're referring to is Common Lisp. Common Lisp is another great Lisp, but I prefer Clojure over it because Common Lisp isn't really going anywhere. It's old and rather stagnant, after all these years has little library support, has no standard concurrency support, and isn't really all that functional unless you want it to be. However, it IS a Lisp, so it's in my camp as well. It's a great language, and you benefit greatly from learning and using it as well. I just prefer Clojure over CL because I like the decisions that Rich made with Clojure, and I like the fact that it's on the JVM giving it access to the entire Java ecosystem, and the fact that Clojure isn't held back by Lisp's past baggage.

OCaml is an entirely different beast. It's in the range of Haskell-like languages, only it's not a pure functional programming language. I have nothing against OCaml, and it's not a Lisp, and doesn't really offer some of the flexibility that Lisp has (not many languages do), but it's still a great language and worth learning.

These languages have large userbases, but Clojure (and I say this with the confidence of someone who participates in the community) is generally more active than either of those language's communities, and is growing in industrial use very very fast. The IRC channel is proof of this, as is the github activity.

But you've really nailed it on the head: Clojure is a new language. It's not any other language. It's a whole new Lisp with it's own ideas and goals. It's functional, built for concurrency (a la the future) from the ground up, and it's on the JVM which gives it nothing short of instant practicality.

It's a beautiful and important language with a very bright future, a very bright creator, and a very bright group of contributors. I'm going to edit in some of Rich Hickey's talks which I encourage everyone to watch if they're interested in Clojure.


EDIT: After reading over my post, it sounds like I'm saying that languages that don't offer the flexibility of Lisp are lesser languages or something; this is not my intention. The amazing flexibility of Lisp is the main reason Lisp users use Lisp. Not every language can be as flexible, but that doesn't make them lesser languages. I'm merely giving you reasons why I'm so enthusiastic about Clojure, not trying to start another "My language is better than your language!" flamewar.

Lets make love, not war. We can all learn things from each other.

EDIT2: Check out the end of the Miscellaneous section for some new stuff I added.

This post has been edited by Raynes: 12 May 2010 - 06:27 PM

Was This Post Helpful? 1
  • +
  • -

#5 programble  Icon User is offline

  • (cons :dic :head)

Reputation: 49
  • View blog
  • Posts: 1,315
  • Joined: 21-February 09

Re: Clojure Resources Thread

Posted 14 May 2010 - 09:27 PM

Great long list of great links.
Was This Post Helpful? 0
  • +
  • -

#6 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Clojure Resources Thread

Posted 09 June 2010 - 12:42 AM

In the Learning Clojure category:

http://github.com/relevance/labrepl

From github:

"Labrepl is an environment for exploring the Clojure language. It includes:

a web application that presents a set of lab exercises with step-by-step instructions
an interactive repl for working with the lab exercises
solutions with passing tests
up-to-date versions of Clojure, contrib, incanter, compojure and a bunch of other libraries to explore
See instructions below for getting started with NetBeans/Enclojure, Eclipse/Counterclockwise, Maven, Mac/Linux command line, Windows command line, IDEA/La Clojure, and Emacs."
Was This Post Helpful? 0
  • +
  • -

#7 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Clojure Resources Thread

Posted 29 June 2010 - 01:19 PM

http://github.com/liebke/clj

This is a must-have for anyone wanting to run a Clojure REPL in a non-project based setting. Leiningen is great for running REPLs per-project, but this is great for when you just want to fire up an REPL without being in a project.
Was This Post Helpful? 0
  • +
  • -

#8 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Clojure Resources Thread

Posted 09 July 2010 - 12:16 PM

Just pointing out that the link above has changed. clj is cljr now and is located at http://github.com/liebke/cljr
Was This Post Helpful? 1
  • +
  • -

#9 Hoornet  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 5
  • Joined: 19-April 10

Re: Clojure Resources Thread

Posted 20 August 2010 - 06:03 AM

Just wanted to tell everyone that Clojure 1.2 has just been released!
You can download it at: http://clojure.org/downloads
Was This Post Helpful? 1
  • +
  • -

#10 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Clojure Resources Thread

Posted 01 October 2011 - 08:22 AM

Just updated the stuff in the post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1