What is Clojure useful for?

Fortyrunner picture Fortyrunner · Nov 23, 2010 · Viewed 51.4k times · Source

What real world applications are people using Clojure for?

I use Groovy for glue stuff, Java for big systems, Python/Perl scripts for parsing and glue. I could see myself calling into Clojure from Java but I can't see where I would use it in its own right. It strikes me it would be easier to use almost any scripting language for adhoc tasks.

I'm not a Groovy expert or a fanboy by any means but it strikes me that it has a better support framework, tools and a lot of the language constructs (closures, functional programming). The same could be said for Scala.

Could it be that its future is as a language that is embedded in other systems?

Answer

dnolen picture dnolen · Nov 23, 2010

I've used Clojure for:

  1. Scraping web pages
  2. Shell scripts
  3. Building websites
  4. Playing around with OpenGL
  5. Writing async webservers
  6. HTML Templating
  7. Running parallel tasks (fetching multiple URLs and process in parallel)
  8. Playing around with real time audio
  9. Simulations

That's the practical / fun stuff.

But Clojure has plenty of theoretical depth as well. Ideas that will become increasingly more relevant as the mainstream comes to really understand the potential of Functional Programming.

A personal opinion, but Clojure flat out provides better language constructs for organizing software correctly (without causing undue pain for the working programmer) of all the languages I've used thus far academically and professionally - C, C++, Objective-C, Java, JavaScript, Python, Ruby.

Which isn't to say Clojure is perfect. But it seems to me that it's built on a better foundation than most of what's out there.