15 ms·
Ask HN: Who's using Clojure, and to do what?
Hello everyone,
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.
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?
Bonus points if you can tell what specific features made it a better language for the task.
- tptacek 16y agoMy 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.
- wglb 16y agoHmmm. Well, in addition, the other night, I was looking at the java vm spec and mulling over some dissatisfactions with jad. Where could that lead. Oh, and, as I told "First Blood", quoting from Watchmen, "you think i am in here with you, but, really, you are in here with me."
- calibraxis 16y agoOut of curiosity, what are your objections?
- wglb 16y agoWe do most everything in ruby. It is very cool for the kind of work we do. And being a lisper, I must say that I really do like Ruby.
- tptacek 16y agoIt scares the crap out of clients.
- jimbokun 16y ago(Tell them it's just another jar file deployed with the application. Unless they need to see the source code...)
- fierarul 16y agoNot 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 16y agoBollocks. We AOT-compile and then obfuscate closed-source clojure code shipped to commercial customers.
- brlewis 16y agoOn the flip side, don't they also think you're geniuses to be able to use it?
- iamelgringo 16y agoBackType is a YC (08?) company. They manage Terabytes of real time data using Clojure + Hadoop/Pig: http://www.backtype.com/opensource http://www.backtype.com/opensource
- nathanmarz 16y agoWe don't use Pig, we use a Clojure-based query language for Hadoop that we wrote called Cascalog: http://github.com/nathanmarz/cascalog http://github.com/nathanmarz/cascalog
- iamelgringo 16y agoMy bad. Sorry.
- hga 16y agoFlightCaster (YC S09) uses it in production: http://www.google.com/search?q=flightcaster+clojure http://www.google.com/search?q=flightcaster+clojure
- davidkellis 16y agoI 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.
- thesnark 16y agoCan you tell us more about your data set?
- davidkellis 16y agoYes, in the backtesting trials I ran, I tested three technical trading strategies using EOD adjusted closing prices between January 1, 1985 and May 1, 2010. I only conducted trials against current S&P 500 member companies. I licensed the data from Norgate Investor Services. I am not affiliated with that company. They just had a price that I, as a poor graduate student, could afford.
- thesnark 16y agoGotcha. How do you think it would hold up to larger, say intraday data?
- davidkellis 16y agoAs far a runtime performance goes, my backtesting framework would run slightly slower using intraday price history than it does with EOD data. There are two reasons why: 1. There would be more data to load into memory, and that process of loading the price history from a CSV file into memory would take a little longer simply because there is more data to deal with. 2. The data structure I'm using to index the historic price information by timestamp is the Java 6 implementation of TreeMap. The TreeMap class is an implementation of a Red-Black tree, and provides a guarantee that lookup operations (even when the key is not present in the collection) are O(log n). Since the time to find a key in the collection is O(log n), there would be a small performance hit when adding more data to the collection. I actually began using intraday price history that I had downloaded from TradeStation, but I ran into the problem that I only had intraday price history over a 1-year period. I needed to be able to run 1-year trials over the course of a much larger period of time, so I switched to EOD data. Switching to EOD data had the nice side effect of speeding up my program (mainly due to the fact that loading all that intraday price history into memory took several seconds - up to 30 seconds or so).
- gfodor 16y agoI work at Etsy. I launched a new search tool powered by Clojure last week: http://www.etsy.com/explorer 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 16y agoYour job postings mention Scala in several places. Are you using both internally or is this Clojure project more of a one-off?
- gfodor 16y agoWe're using both, but right now this project is the first use of Clojure. We have a lot more Scala code.
- andrewvc 16y agoAre you using clojure for the front end? Are you using ring/compojure or something else?
- gfodor 16y agoThe clojure code is a hand-rolled algorithm that sits behind a compojure web service. The front-end is just standard jQuery hackery :)
- cageface 16y agoI'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.
- cemerick 16y agoDocuHarvest is a web application for extracting valuable data from documents (just PDFs for now): https://docuharvest.com https://docuharvest.com Short reason: JVM perf/libs + persistent data structures + lisp goodness (macros etc.) is a helluva package deal.
- ihodes 16y agoWriting 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 16y agoWarning: 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?
- ramidarigaz 16y agoMany is correct. Many refers to countable items, much refers to uncountable items. Many apples vs much wine, many lines of code vs much text. I do agree with your assessment of the awkwardness of the phrase though.
- galois 16y ago"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 16y ago"...someone of such low caliber..."? Was that really necessary?
- Zak 16y agoI 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.
- astine 16y agoIs 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.
- richard_lyman 16y agoI've used Clojure to write clj-peg (http://www.lithinos.com/clj-peg/index.html 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 16y agoThis 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!
- cemerick 16y agoI'll second the github suggestion. clj-peg looks very interesting.
- philh 16y agoAnother 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 16y agoIt'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 16y agoI 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.
- joubert 16y agoI used clojure to build http://elev.at 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.
- tkahn6 16y agoI'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/ http://clojure.blip.tv/
- hugoduncan 16y agoI'm building CloudHoist.com, a cross-cloud console that does node provisioning, configuration and administration. http://cloudhoist.com/ http://cloudhoist.com/ Lisp in general is amazing, and being able to deploy to the JVM is a huge win for Clojure.
- math 16y agoI'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 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.
- gcv 16y agoClojure'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 http://github.com/gcv/dgraph I also wrote an embedded database library for Clojure, based on Berkeley DB. http://github.com/gcv/cupboard http://github.com/gcv/cupboard Which specific features make Clojure a good choice? Interactive development and macros.
- MrRage 16y agoI'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 16y agoSwing 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.
- ww520 16y agoCan Clojure be used in Android app development? Since Android apps are JVM-based.
- rabidsnail 16y agoAndroid 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.
- puredanger 16y agoWe'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 16y agoWe 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 http://infinitelybeta.com). We are launching in a month, I will announce when we do.
- amatos 16y agoAlgorithmic 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.
- smartrevolution 16y agoWe 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 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 16y agoI 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."
- elcron 16y agoI'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.
- rosejn 16y agoI'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 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.