Summary
Clojure is a Lisp dialect for the JVM. Developed mainly by Rich Hickey, Clojure 1.0 was released this week. It supports functional programming, advanced concurrency constructs, such as software transactional memory, multimethods, and interoperability with Java classes and frameworks.
Advertisement
Among the more interesting languages that were developed for the JVM in recent years, Clojure is a dialect of Lisp, and thus supports functional programming. Clojure's main author, Rich Hickey recently released Clojure 1.0:
Clojure represents several years of effort on my part, but has also been shaped profoundly by the community in the 18 months since its release to the public. I can't thank everyone enough for your contributions of ideas, bug reports, suggestions, tests, tools, documentation and code - patches and enhancements...
Clojure ... shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures...
Clojure's many interesting features include support for transactional memory:
Clojure simplifies multi-threaded programming in several ways. Because the core data structures are immutable, they can be shared readily between threads. However, it is often necessary to have state change in a program. Clojure, being a practical language, allows state to change but provides mechanism to ensure that, when it does so, it remains consistent, while alleviating developers from having to avoid conflicts manually using locks etc.
The software transactional memory system (STM), exposed through dosync, ref, set, alter, et al, supports sharing changing state between threads in a synchronous and coordinated manner...
The agent system supports sharing changing state between threads in an asynchronous and independent manner. The atoms system supports sharing changing state between threads in an synchronous and independent manner. The dynamic var system, exposed through def, binding, et al, supports isolating changing state within threads...
What do you think of Clojure? To what extent do you think it helps you solve problems that are harder to solve with Java?
Would this be a decent place to start with learning LISP? I've tried CLISP and I just couldn't get into it. I was thinking that since I am very comfortable with the JVM, this might work better for me.
> Would this be a decent place to start with learning LISP? > I've tried CLISP and I just couldn't get into it. I was > s thinking that since I am very comfortable with the JVM, > this might work better for me.
I have no direct experience about Clojure, but from what I read in Lisp forums it is a nice modern Lisp with a strong functional feeling and excellent support for the JVM. If I were using the JVM I would certainly look at it.
> Would this be a decent place to start with learning LISP? > I've tried CLISP and I just couldn't get into it. I was > s thinking that since I am very comfortable with the JVM, > this might work better for me. > I haven't used it either, but I want to learn it as soon as I get time. All I've heard about it has sounded positive. I did read a Lisp book many, many years ago, but I don't think I really got the functional side of it at that time. I was looking for insights into AI back then. Anyway, I think there are things to be learned about concurrency by learning Clojure too, as that seems to be the main problem area it targets.
Between Rich Hickey's podcasts and the great reviews I've read, Clojure is right up there for languages to learn. Transactional memory is particularly something I'd like to experiment with. Currently I have the REPL installed on Netbeans and switch to it periodically between Scala sessions. (Gotta' say that REPL's are difficult until you think in the language.)
> Would this be a decent place to start with learning LISP? > I've tried CLISP and I just couldn't get into it. I was > s thinking that since I am very comfortable with the JVM, > this might work better for me.
Depends on you and how you learn best. If you want to learn only one Lisp variant, Scheme might be a better place to start. It's got an excellent IDE in DrScheme and tons of learning material.
On the other hand, if you learn better by solving problems you have right now, then Clojure might be a better place to start.