Clojure roundup

January 10, 2009

In the last few weeks, there’s been a fair amount of Clojure news and activity here in our study group. Here are some links to things we’ve been watching.

  • A new language release. On December 17th, Rich “cut a new release” of the language. This should bring the offical release up to date enough for most people, although you’re still advised to check out the latest from Subversion, especially a few months go by without another official release
  • Streams vs. sequences. A lively discussion about the right implementation(s) of laziness and the role of caching in Clojure’s sequences. There is a move afoot to add true streams to Clojure, although the ramifications of such an addition are uncertain.
  • Compojure. Yes, Clojure has its own web framework now, and it looks pretty smart. Its syntax is inspired by Ruby’s Sinatra, it interfaces with Jetty, and it lets you write HTML in a vector-tree fashion that looks odd but probably saves the experienced user lots of keystrokes. Eric Levigne has written some posts about using Compojure to run a website.
  • Paul’s article on bean and Java interop. A nice tip on making it easier (and more Clojure-ish) to work with Java libraries.
  • Luke’s Markov chain generator and Michael’s post about it. Luke wrote a cool program that generates an output text from the pieces of an input text and uses pattern analysis and probability to mimic the style of the input text. Your humble blogger responded with a post examining the workings of the program and suggesting ways to build on it. This could become a group project.

That isn’t everything that happened in Clojure lately, not by a long shot, so feel free to comment to ad your own observations. Also, consider joining our study group list (link in the column to the right) to contribute. You don’t have to be in DC or come to meetings–we’d love to hear from you.

Advertisements

Next meeting rescheduled to Saturday January 31st

January 10, 2009

We will still meet at St. Stephens, in northwest DC, just a week later than we’d initially planned: on the 31st at 1PM, a day before Paul Barry’s beloved Baltimore Ravens take the field in Superbowl 0x2B.

Concurrency is still on the agenda. Watch for an update to the Programming Clojure PDF soon: Stuart Halloway has pledged to try to get us a more complete Concurrency chapter with a discussion of atoms. Thanks, Stuart!

If the door is locked on the 31st, we’ll post a note with my cell phone number for you to call for entry. I hope to see you there.


Emacs, Slime, and Clojure update

January 5, 2009

Some of you have noticed that when combined, the latest versions of the set of tools for editing Clojure in Emacs aren’t playing well together. Life on the bleeding edge means occasional paper cuts. I don’t yet understand exactly how Emacs, SLIME, and swank are working together, but I have been able to follow some advice online to fix the troubles I was having.

When starting SLIME in Emacs, everything seemed to work–Emacs and SLIME appeared to be communicating over local ports–but then an error message popped up:

error in process filter: Symbol's function definition is void: slime-redirect-inferior-output

I use Bill Clementson’s emacs setup, which he described on his blog. It turns out Clementson was already aware of the problem, which he describes in a thread on the Clojure mailing list. In a nutshell, swank-clojure has been updated and is a bit out of whack with the other edting tools. A patch has been applied, and if you checkout the latest tools, you’ll now get the patched version. You must then make a minor change to your .emacs file (Preferences.el for me and my Aquamacs setup):

From:

(eval-after-load "slime"
'(progn
(slime-setup)
...

to:

(eval-after-load "slime"
'(progn
(slime-setup '(slime-repl))

And then restart emacs. Works like a charm now. Thank you, Clojure community!


Next: Concurrency on January 24th, 1PM

January 5, 2009

** Update: Meeting is rescheduled to Saturday, January 31st, 1PM, at St. Stephens Church. **

Thanks again, everyone, for a great meeting on the 3rd of January. Our next meeting will take place on Saturday the 24th at 1PM in the same location as last time, St. Stephen’s Church at 1525 Newton St NW. We’ll be discussing concurrency.

Your homework for the meeting is the Concurrency chapter in Programming Clojure. Give yourself plenty of time for this text: unless you are familiar with concurrency already, you will probably find this chapter challenging. Concurrency is what Clojure is all about, though, so press on!

Also, please think about little projects or exercises we could undertake in small groups to try out what we’ve learned. Last time we considered card games and exercises from other Lispy textbooks before tackling the Swing app. These might be good ideas again. What kind of concurrent situations come up in software or in real life?

If you haven’t joined us yet or would like to, feel free! We’re still in our tutorial/mentoring
phase, and the environment is welcoming and helpful to novices. If you’re already experienced with Clojure or similar technologies, we’d love to have you join us too.

See you on the 24th.