aspose file tools*
The moose likes Clojure and the fly likes Clojure development environments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » Clojure
Bookmark "Clojure development environments" Watch "Clojure development environments" New topic
Author

Clojure development environments

Rick Goff
Ranch Hand

Joined: Nov 14, 2006
Posts: 54

Thank you for this new book. I've read some of it online, and I certainly look forward to reading the rest. (I'm also excited about the 2nd ed. of Stuart Halloway's book, _Programming Clojure_.)

Can you discuss development environments? Talk about the level of effort and expertise required to get started in:

1. The executable jar
2. clooj
3. Counter Clockwise
4. Eclipse
5. Emacs/swank

If I were evangelizing Clojure, the first thing I would want the recruit to see is how productive and fun the REPL environment is.


OCPJP 6
Sean Corfield
Ranch Hand

Joined: Feb 09, 2011
Posts: 232
    
    3

Rick Goff wrote:Can you discuss development environments? Talk about the level of effort and expertise required to get started in:

I'm sure Chas et al will jump in with more detail but I wanted to respond with a couple of points.
1. The executable jar

I really wouldn't bother with this and I wish the main Clojure site would just recommend Leiningen instead. Yes, it's straightforward if you're used to command-line Java execution and the classpath but it's a very basic REPL experience and not a great introduction to Clojure.
2. clooj

This is built and maintained by one of the guys in my local Clojure user group and he gave us a short presentation on some new features back in June: http://vimeo.com/43995167

You download the JAR, you double-click it - instant IDE with project support and a built-in REPL. Very easy to get started with. It's improving all the time but for most people, once you start building real systems with Clojure, you'll outgrow it and want to move on to a "real" IDE.
3. Counter Clockwise
4. Eclipse

Since Counter Clockwise is "just" a plugin for Eclipse, these really go together. I used CCW/Eclipse for a while and it's a good combination that will feel familiar to Java developers (if they use Eclipse). Chas can speak to this in a lot more detail since he's a contributor and heavily involved with the project.
5. Emacs/swank

This is my IDE of choice these days. Despite what some Emacs fans will tell you, it is not easy to setup, nor easy to learn (and almost no one ever truly "masters" Emacs), but it is extremely productive and has the best REPL integration of any of the IDEs (because it was designed for Lisp).
If I were evangelizing Clojure, the first thing I would want the recruit to see is how productive and fun the REPL environment is.

Definitely! I recommend downloading Leiningen - a simple shell script - and then "lein repl" gives you a nice, rich experience and you also have a full project / build tool in hand.
Chas Emerick
author
Greenhorn

Joined: Jun 27, 2012
Posts: 27

Rick Goff wrote:Thank you for this new book. I've read some of it online, and I certainly look forward to reading the rest. (I'm also excited about the 2nd ed. of Stuart Halloway's book, _Programming Clojure_.)

Can you discuss development environments? Talk about the level of effort and expertise required to get started in:

1. The executable jar


I don't think it's worth starting there at all. The basic REPL is too basic, and new users often don't know where to go from there for builds, dependency management, etc. If you're using Ant or Maven or Gradle, plugins are available to get you started with Clojure straight away; otherwise, go grab Leiningen. It's a very slick quick-start experience that includes a great REPL.

Rick Goff wrote:2. clooj


I'm afraid I've never used clooj, sorry.

Rick Goff wrote:3. Counter Clockwise
4. Eclipse


Eclipse uses the Counterclockwise plugin for its Clojure support (search for "clojure" in the Eclipse marketplace). I'm a contributor to that project, and it's what I use 24/7, so I may be biased, but I think it's the best option around for most people in terms of providing a practical mix of easy setup, integration with whatever build tool you care about (including Leiningen), reasonable text editing capabilities, and excellent (again, IMO) REPL support.

Rick Goff wrote:5. Emacs/swank


Emacs + SLIME/swank is nearly unbeatable in terms of absolute text editing power (they'll have to fight things out with the vim guys for that title), and it has a number of bells and whistles that are not available elsewhere. However, I think that, for most people, the usability issues around Emacs are large enough that I wouldn't recommend it unless you either know emacs already, or are interested and motivated enough to focus on learning Emacs as a distinct endeavor. I certainly wouldn't recommend trying to learn it at the same time as you learn Clojure, if you're new to both.

Rick Goff wrote:If I were evangelizing Clojure, the first thing I would want the recruit to see is how productive and fun the REPL environment is.


Indeed, which is why we emphasize "REPL-Oriented Programming" in the book (it has a whole chapter dedicated to the REPL and the types of development workflows that it makes possible), and why I talked about it some in my Starting Clojure screencast.

--
(coauthor of Clojure Programming from O'Reilly; creator of Clojure Atlas)
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1479
    
  11

What's the situation with tools to support debugging?

You've mentioned the relative ease with which code can be generated in Clojure, but how easy is it to inspect and step through this generated code at runtime?


No more Blub for me, thank you, Vicar.
Chas Emerick
author
Greenhorn

Joined: Jun 27, 2012
Posts: 27

chris webster wrote:What's the situation with tools to support debugging?

You've mentioned the relative ease with which code can be generated in Clojure, but how easy is it to inspect and step through this generated code at runtime?


Any JVM debugger can be used with Clojure code, as line numbers and filenames are included in the bytecode generated by Clojure by default. For example, you can set breakpoints in Clojure source files in Eclipse + Counterclockwise, and when execution pauses at the breakpoint, you can step into, over, and out of function and method calls, inspect locals, etc. The same goes for IntelliJ's Clojure support, and other debugger tools like JSwat.

One wart there is that Counterclockwise does not yet provide presenters for the Eclipse debugger UI to show Clojure collections pleasantly; so, if you have a map argument in a function that execution is paused at, the value shown in the debugger's inspector is Clojure's map implementation class, not an e.g. browsable tree representation of the map's entries. This item is fairly high on the TODO list for Counterclockwise.

Note that this presenter issue is an area where Emacs + SLIME currently does very, very well.

--
(coauthor of Clojure Programming from O'Reilly; creator of Clojure Atlas)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Clojure development environments
 
Similar Threads
iPhone Apps: pitfalls in development
Joy of Clojure - Questions
Clojure Programming - Few Questions
Is "The Joy of Clojure" for beginners?
Clojure 1.4.0 Released