
Ask HN: Who's using Clojure, and to do what? - gregschlom
Hello everyone,<p>I've seen a lot of articles on HN recently talking about Clojure. I had a quick look at a few pages (Wikipedia, etc...), and I can't help but think that it sounds like the new cool language, pretty much like Ruby in 2007.<p>But to get a better idea, I'd like to hear the feedback from the community: Who is using Clojure (in real-life cases), and what are you doing with it?<p>Bonus points if you can tell what specific features made it a better language for the task.
======
philh
Another important question to ask is: if you're not using clojure, is there a
clojure-specific reason for that? (ie. "I would use clojure but...")

In my case: I reported a bug in the clojure.contrib XML library, on the google
group. It's a trivial fix, but not worth the hassle of signing a contributor
agreement. So although I'd fixed it myself, I couldn't send a patch. All I
could do was report it - and the report was ignored.

Some time later, I reported another, deeper bug that I didn't know how to
begin fixing (but did know a workaround for). It got ignored too.

I like the language, and I'm not going to say my experience was typical of the
community. I spent some time hanging out on the group and the people there
seemed friendly and helpful. But that's one reason I no longer use it.
(Another reason is "no reason at all", and I don't know the relative weights
of these reasons.)

This feels a little like whining to me, but feedback should be both positive
and negative.

~~~
technomancy
It's not just you. Requiring copyright assignment is a powerful way to put the
brakes on community involvement by itself, but couple that with a policy of
"nothing gets applied until the BDFL personally approves it" and things can
get frustrating. I've had bugs with perfectly viable patches linger in the
issue tracker for 3-4 months before getting applied. In some cases the
original author of the library even personally approved the patch, but it
still had to wait for the thumbs up.

Hopefully this will improve with the creation of the Clojure/core group.
Having every commit need to be approved by a single person is absolutely
unsustainable in the long run, and we're definitely already at to the point
where it's causing issues.

That said, it certainly doesn't stop me from using Clojure every day; it just
makes me prefer decentralization (using 3rd-party libraries rather than
contrib, for example) where possible.

~~~
technomancy
I should add that having Rich review every single commit is very appropriate
for some parts of Clojure: I wouldn't want people committing to the STM
mechanism or to the implementation of clojure.lang.PersistentVector without
his approval. And for a long time Clojure almost entirely consisted of this
kind of code--stuff that's really hard to get right.

But now it's had more more pedestrian nuts-and-bolts kind of libraries added
like clojure.test and clojure.main. These are included out of necessity, but
they are very easy to understand and fairly easy to patch and improve as well.
It would be reasonable if the original authors were allowed to improve them
and accept patches from the community for them even after they've been
promoted from contrib.

------
Zak
I wrote a text classifier in Clojure and I'm currently developing it in to a
product. It is fairly good at author identification, with a substantially
better success rate than libsvm, the tool most commonly used in academic
papers.

I'm looking at several possible applications, the one I find most interesting
being a tool to catch students who pay others to write their papers.

Clojure has a few features that have been a big help. The rich set of tree-
based data structures is especially helpful because it makes splitting and
merging data inexpensive. The ability to inexpensively switch to mutable
versions and back where appropriate for performance reasons is also quite
nice, and absent from most other functional languages. The fact that its a
Lisp has advantages that should be well-known by most people here.

Edit: the fact that it's fast is also important for my application. I need to
be able to do classification on a large number of possible categories at web
speed.

------
gfodor
I work at Etsy. I launched a new search tool powered by Clojure last week:

<http://www.etsy.com/explorer>

It's used for the autosuggest and facet suggestion on the sidebar.

We'll be posting more about this on our tech blog sometime soon.

~~~
cageface
Your job postings mention Scala in several places. Are you using both
internally or is this Clojure project more of a one-off?

~~~
gfodor
We're using both, but right now this project is the first use of Clojure. We
have a lot more Scala code.

------
iamelgringo
BackType is a YC (08?) company. They manage Terabytes of real time data using
Clojure + Hadoop/Pig:

<http://www.backtype.com/opensource>

~~~
nathanmarz
We don't use Pig, we use a Clojure-based query language for Hadoop that we
wrote called Cascalog:

<http://github.com/nathanmarz/cascalog>

~~~
iamelgringo
My bad. Sorry.

------
davidkellis
I don't know if you consider this "real-life", but I used Clojure to implement
and run stock strategy backtesting trials for my master's thesis project. I
defend my thesis on June 29th.

The big reason I used Clojure was that it was _easy_ to parallelize my
program; however, running independent trials with many different parameter-
sets is one of those "embarrassingly parallel" tasks.

~~~
chink
Very interesting. Did you consider using R? Why did you choose Clojure for
this? I've been thinking of doing something similar myself and I would love to
hear your thoughts considering you've already been-there-done-that.

I'd love to read your thesis and code, if they're available.

~~~
piggybox
R does have quite a bit of financial libraries, yet I don't remember R has any
good support on parallel computing, hmm?

~~~
chink
True, but Matlab has good support for distributed computing. It's even
possible to do this on an EC2 cluster. Pretty impressive really:
<http://www.mathworks.com/programs/techkits/ec2_paper.html>

edit: Cleaned up my bad grammar.

------
gcv
Clojure's a decent choice for writing a cross-platform UI application, using
Swing. Java+Swing sucks, but Clojure+Swing works pretty well. I wrote a
dependency graph library, dgraph, which significantly reduces the amount of
boilerplate required to keep UI state in sync.

<http://github.com/gcv/dgraph>

I also wrote an embedded database library for Clojure, based on Berkeley DB.

<http://github.com/gcv/cupboard>

Which specific features make Clojure a good choice? Interactive development
and macros.

~~~
MrRage
I've been considering writing a desktop app. I've been wanting to get into the
JVM action, but dimly remember being scared off by Swing years ago. What about
Clojure makes it better at using Swing?

~~~
LaPingvino
Swing can be a lot of repetitive code. Clojure has mechanisms (functions,
macros and libraries) that can help you to abstract this away to exactly the
way you like to write user interfaces.

------
richard_lyman
I've used Clojure to write clj-peg (<http://www.lithinos.com/clj-
peg/index.html>). I then use clj-peg everytime I've needed to process some
consistent structure (RTMP/AMF0/AMF3), anytime I want to create a quick DSL
(the source markup for my site), and just for fun (looking into writing a
markdown grammar).

Macros were essential to what I wanted in a PEG-based system. I wanted to use
as few extra characters as possible to increase readability, since fewer
characters meant less clutter around the Non-Terminals. I also wanted a custom
syntax that leveraged the basic approach of the parent language to minimize
the learning curve. Macros allowed me to easily introduce those features
inline with the rest of the language.

I've also wanted to use a language that was moving toward platform
independence so that my efforts would last longer. Clojure isn't far (a year
or so) from being more easily implemented on platforms other than Java. I'm
fairly convinced that they'll make it and clj-peg will take advantage of that
if it can.

While Common Lisp, among other languages, meets the macro feature, and I
developed in Common Lisp for a while, bringing the Java ecosystem into the
picture solves other problems I had had with common lisp.

In addition to clj-peg, there are other projects that are in-process, but I'd
rather not bring them up here since they don't have the resources that clj-peg
currently has.

To sum up: Macros and the Java ecosystem.

~~~
scottdw
This project looks interesting and although I don't have much time to get into
it at the moment I'm mainly commenting to create a personal bookmark for it
and to thank you for sharing your project.

Please consider moving the project to a hosting site like github which would
make it easier to track updates to it and easier to find in the future. Thanks
again!

------
rosejn
I'm using Clojure for my PhD thesis project, implementing a distributed
computing framework for building P2P applications. I've also been creating an
audio synthesis and musical live-coding system, available here:

<http://project-overtone.org>

Clojure has without a doubt been the most eye opening language I've learned in
the last 10 years. I highly recommend giving it a try. It has powerful yet
incredibly simple to use constructs for dealing with state in a multi-core
world, and I think it far surpasses everything else out there today for
parallel programming. The centerpiece being a built-in software transactional
memory system that enables composable, deadlock free, multi-threaded
coordination.

Beyond solid support for concurrency, the standard library provides an elegant
set of programming tools that will make you realize how even expressive
languages like python and ruby make you jump through lots of unnecessary
hoops. In Clojure you represent everything with basic maps, sets and
sequences, and the standard library has extensive tools for manipulating these
things. (By the way, your code is also available for manipulation with these
same tools.)

Macros let you peel away every last bit of boiler plate, and what you realize
is that in the end all of programming is just arithmetic, iteration,
branching, and assignment. Everything else is just getting in the way of your
core logic. I think Clojure lets you get to the center of your problem with
the least overhead possible.

------
tptacek
My friend and coworker 'wglb uses it, over my weak and pitious objections, to
build network protocol fuzzing code here. Don't worry, we'll beat the Clojure
out of him soon enough.

~~~
calibraxis
Out of curiosity, what are your objections?

~~~
tptacek
It scares the crap out of clients.

~~~
jimbokun
(Tell them it's just another jar file deployed with the application. Unless
they need to see the source code...)

~~~
fierarul
Not sure how good the compiled Clojure code is. Also -- it might be too
dynamic to allow any kind of obfuscation so it won't be used for stuff that's
sold with licenses for example.

~~~
cemerick
Bollocks. We AOT-compile and then obfuscate closed-source clojure code shipped
to commercial customers.

------
ihodes
Writing a baked blogging engine in Clojure, heavily using Enlive for a large
chunk of it. Many fewer lines of code than doing it in Python/Ruby.

Plus, honestly, it's a lot of fun to use.

Next up is some data analysis: I'm looking into the excellent Incanter for
that.

Great libs, great community and a fun, fun language that's practical and
elegant.

EDIT: to expand on what I like about the language; it's a lisp, so everything
that comes with that. It's also got some syntax that simply makes it more
pleasant to use on a day-to-day basis. And so much more!

(excuse typos: my phone is acting up today/can't handle HN for long comments.)

~~~
jscn
Warning: irrelevant grammar nazism below.

> Many fewer lines of code than

This grammar bugs me. I feel like this should be "Much fewer" or similar, but
I'm not totally sure it's wrong as posted. Opinions?

~~~
galois
"Many fewer" should be technically okay.

"Much fewer" is definitely wrong.

"Far fewer" would be my choice.

Normally, grammar nazis at least know something about, which you clearly do
not. Why does someone of such low caliber try to correct others?

~~~
dunstad
"...someone of such low caliber..."? Was that really necessary?

------
cemerick
DocuHarvest is a web application for extracting valuable data from documents
(just PDFs for now):

<https://docuharvest.com>

Short reason: JVM perf/libs + persistent data structures + lisp goodness
(macros etc.) is a helluva package deal.

------
hugoduncan
I'm building CloudHoist.com, a cross-cloud console that does node
provisioning, configuration and administration.

<http://cloudhoist.com/>

Lisp in general is amazing, and being able to deploy to the JVM is a huge win
for Clojure.

------
cageface
I'm using it to verify replication between a big sybase instance and a big
oracle instance. This isn't rocket science but performance is much better than
it was in Python and the code is about the same size.

I'm also and to liberate data from a MeetingMaker server that's only available
via a Java api and make it available in Rails apps. Obviously the superior
expressiveness of Clojure makes the code base a lot smaller and makes more
sophisticated processing of the data far simpler than it would be in Java.

Hopefully more soon.

------
joubert
I used clojure to build <http://elev.at>

Clojure code services the HTTP service calls (multimethods are very nice here)
and also does the job of converting spreadsheets or CSV files into XML.

------
puredanger
We're building semantic web apps for data integration. Clojure is great for it
as it's all either symbolic manipulation (query translation and planning) or
moving data with as little overhead as possible.

------
zaph0d
We are an Indian startup and we are building a next-gen finance webapp in
Clojure & Python.

We are using Clojure since the early days and we are extremely happy with it.

We used Clojure to build a finance engine which aggregates financial info from
various places, stores them in the DB and serves them over a RESTful HTTP API.

Clojure's awesome concurrency semantics and the overall power of Lisp combined
with the vast JVM ecosystem has helped us a lot.

We are Infinitely Beta (<http://infinitelybeta.com>). We are launching in a
month, I will announce when we do.

~~~
chink
Do you have an announcement mailing list? Or blog RSS feed?

~~~
zaph0d
Not yet, but you can follow the team on Twitter -
<http://twitter.com/ghoseb/infinitely-beta>

------
smartrevolution
We have build a large Web-Application with Clojure. It runs on Google App
Engine and we are really happy with our decision. You can find it here:
<http://the-deadline.com>

We use the power of lisp to extend the language for specific tasks, like
accessing the distributed key/value datastore or building an expert-system
shell.

~~~
DennisP
I don't normally correct people's spelling but in this case...you've got an
error on your company homepage. Should be "they don’t need to be as daunting
as we tend to _perceive_ them."

------
astine
Is used clojure to build a front-end to an inventory program I wrote for the
Library of Congress.

There are a lot things to like about clojure, but the reason I chose it for
this task was that it was the only language on the JVM that had a usable
(imho) repl.

------
math
I've done about 4 non trivial projects with Clojuire. (a) some fairly serious
SEO related to RFS1 (b) a news aggregator (c) music-compojure
<http://github.com/mhowlett/music-compojure> (d) some investment portfolio
performance calculations.

I really like the language. Am I productive with it? Not really - as a guess,
I'm about 3 times faster with .NET / C# (with which I'm very experienced). I
might be able to get to the same level of productivity, but it'd certainly
take me a while to get there.

~~~
Devilboy
Have you experimented with F# a bit yet?

~~~
math
Not really because I'm fairly keen to move away from the Microsoft platform.

------
amatos
Algorithmic trading. Currently only a GUI for managing my existing trading
algorithms in Java and a evolutionary algorithm I use for optimizing
parameters, but I am looking at using Clojure to implement the trading
algorithms themselves.

Pros: wonderful integration with Java, good support for concurrent
programming, conciseness, macros.

Cons: numerically intensive code can be a bit slow (but it is going to improve
significantly with 1.2, and you can always do that in Java), prefix notation
can be quite hard to read if you are dealing with complicated math
expressions.

------
ww520
Can Clojure be used in Android app development? Since Android apps are JVM-
based.

~~~
rabidsnail
Android isn't jvm based. They wrote their own VM with their own bytecode
format, and a bytecode translator from java bytecode. Since the translator is
written in java, it is possible to run it through itself and use that to run
clojure, but it's dog slow. Even when statically compiling a sample "hello
world" clojure app for android the bootstrap process takes over a minute.

------
elcron
I'm hoping to port it to the CRIO for FIRST robotics, but I haven't looked
into trying yet. All my other projects have been relatively minor so far.

------
hga
FlightCaster (YC S09) uses it in production:
<http://www.google.com/search?q=flightcaster+clojure>

------
tkahn6
I'm an soon-to-be-undergraduate just learning the language and Lisp.

I found this great series by Rich Hickey last night: <http://clojure.blip.tv/>

