I’m posting the code I’ve written for date management in the mashup project. It’s just a sketch, really. There’s plenty of work to do to fill it out. But I wanted to post what I’ve got now.
Just a quick post to mention how Clojure was mentioned at the RubyNation conference in Reston last weekend.
I gave a lightning talk on day 2. Slides are posted. I only had 6 minutes, so I kept it brief. I don’t think I convinced a lot of the audience members to try it out. Afterwards, though, I got to talk to Aaron Bedra of Relevance, who was a technical editor for Stu’s book. He reports Clojure is actually in use on commercial projects. He’s a swell fellow.
Russ Olsen gave an impromptu talk at the end of the day about Clojure, Scala, Erlang, and Reia. Two things struck me about his approach to new languages. First, he gives a lot of important to “curb appeal”, or how nice the code looks. The parentheses bother him about Clojure and other lisps, same old story. The second thing, though, is the importance given to metaprogramming, which Ruby has brought into the forefront of a lot of developers’ minds. As Russ pointed out, any Lisp makes metaprogramming easy. So that may be a selling point for Clojure among Rubyists.
We’re meeting face-to-face again on Saturday, May 16th at 1pm, at HacDC’s meeting space in DC. We’ll be meeting to hack some code on our mashup project. Check out the group’s google group for discussion and code produced so far.
We have a capstone project, a reworking in Clojure of some of the mashup features of Yahoo Pipes. At our last meeting, Luke VanderHart presented a framework for building and connecting components. I’m going to recap the framework as well as a few philosophical decisions we hammered out. But I’m also going to invite you to take a look at the code with me, with an eye towards 1) understanding each bit and 2) replaying the development of the framework by starting with simple building blocks. Luke and I both agree that the current framework, although awesome, has leapfrogged the kind of discussion and collaboration we want to foster in the study group. So I’m going to try an experiment with coding in public. On this blog, and soon on github, we’re going to build the framework again, together, feature by feature, always embracing the principle of the simplest thing that could possibly work. We’ll build up the might of Luke’s framework, but in a way that we get there together. And we’ll probably make it better from all being involved.
Read the rest of this entry »
Clojure 1.0 is on the way, and as a result a lot of activity is occurring in the Subversion repository. Revision 1357 of the Clojure source was proclaimed the likely release candidate, although a few minor changes have been checked in since. Likewise, clojure-contrib revision 723 is the likely release candidate corresponding to 1.0. It should be interesting to watch what unfolds in the source until the actual release.
It’s not too late to contribute, and no contribution is too small.
At our latest meeting, we discussed macros and adopted a capstone project, an open-source Clojure implementation of some of the functions of Yahoo Pipes.
Regarding macros, we touched on the chain of events when a Clojure program is evaluated: evaluation runs from top to bottom, and each S-expression is macro-expanded (if possible) and then evaluated. If an expression expands into something that itself contains a macro, the the new macro expression will be expanded before it is evaluated. This allows a macro to use a previously defined function in the determination of its expansion.
“Macros” in Lisp are very different from “macros” in other languages, as they allow the programmer to use all the power of Lisp to determine the macro’s expansion. Macros are not first-class members of the Clojure language, however. You cannot use them as you use functions–you can not use them with map or apply, for example–because macroexpansion happens before an expression can be used in this way.
We also talked about “star” functions and macros. The macroexpansion of an expression that uses ‘
and‘ includes something called
(macroexpand '(and 1 2 3))
->(let* [and__2863 1]
(if and__2863 (clojure.core/and 2 3) and__2863))
We concluded that you really aren’t supposed to see
let*. You only do in this case because
macroexpand completely expands the expression it is given, and it turns out that
let is a macro whose definition includes the mysterious
let*. In fact, a lot of Clojure’s core macros use “star” constructs that appear to be special forms. Some digging at the REPL confirmed that they are not symbols. Likely the “star” forms are transformed by the Clojure parser directly into Java. If you have some special knowledge about this, please post a comment or join our discussion group. We’d like to know more.
Luke presented the case for a project that implemented some of the Yahoo Pipes application. By general acclamation we adopted this project as our capstone. We’ve decided to spend the next two weeks hacking on the basic problems of the project ourselves, keeping in touch through the group mailing list. David set up a github repo for us, with a wiki for collaboration. There you can find the summary of our initial work on defining the project, thanks to Keith. Serge dug up Yahoo’s Pipes documentation.
We’re calling this Tubes right now (as in “teh tubes”), but a final decision on the name (I’m not saying I don’t like Tubes) is one of many tasks we’re deferring. Right now we just want to get things moving. Personally, I expect Paul to have it all done by this afternoon.
Multimethods on Sunday, April 19th, 1pm
Our next meeting will be at least partly devoted to the final topic in Stu’s book: multimethods. Read chapter 8 of Programming Clojure and bring any questions or comments you’d like to discuss. Please notice two things about the next meeting date: 1) it is in two weeks, not three; and 2) it is on a Sunday. The location is still HacDC’s meeting space at St. Stephens, and the time is still 1pm. We hope to see you there.
This Saturday, April 4, at our face-to-face meeting at HacDC, member Luke VanderHart will informally present a case for a Yahoo Pipes-like content aggregator as a possible capstone project. Interested?
Read up on Pipes.
Read Luke’s initial comments.
Of course, we’ll also discuss macros, including the material in Chapter 7 of Programming Clojure.
We hope to see you there: 1PM at HacDC.