my dog learned polymorphism*
The moose likes Clojure and the fly likes Clojure with third party Java libraries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Clojure
Bookmark "Clojure with third party Java libraries" Watch "Clojure with third party Java libraries" New topic
Author

Clojure with third party Java libraries

Eugene Gunov
Greenhorn

Joined: Feb 09, 2011
Posts: 3
Hi, authors and all

I'm a Java developer playing with Common Lisp and Clojure recently.
Glad to see new non-beginner level book on Lisp coming out.

Regarding specifics of Clojure I'm concerned with following.
I've got impression that to code a serious application (integrated with other enterprise systems) you'd need to use extensively some third party java libraries which were not written with Clojure concepts in mind. In this case much of Clojure goodness (immutability, persistent collections, concurrency guarantees) seem to fade away. So you're left basically with Java in parens syntax (i'm overstating a bit).

What are your thoughts on this?
Michael Fogus
author
Greenhorn

Joined: Feb 07, 2011
Posts: 12

Eugene Gunov wrote:What are your thoughts on this?


I for one think that the availability of the Java ecosystem is a great boon to Clojure. Some of the best libraries and systems built with Clojure leverage existing libraries heavily. Granted there is often an impedance mismatch between the way that Java libraries are constructed and what constitutes idiomatic Clojure code, but I've never found it to be a barrier. Like any project, using existing libraries requires some thought about how you want to express the solution and how the library fits into that model. Where Clojure helps in this regard is that its programming model is extremely malleable. Very often it's as simple as creating a facade of functions over the library in question. I don't want to speak too generally however since every library and every project is different.
Eugene Gunov
Greenhorn

Joined: Feb 09, 2011
Posts: 3
Thanks for the reply, Michael. An old saying - "Our greatest strength is also our greatest weakness" comes to mind. I hope to get a chance to judge it for myself in practice agreed.
 
 
subject: Clojure with third party Java libraries
 
Similar Threads
Java XMLRPC
java-to-PDF with jdk1.4 (or java 5)
No class error
Real-life Clojure examples
Oh my gawd, Java is doomed