Monthly Archives: June 2011

Noir: websites in Clojure

http://www.webnoir.org/

Noir is a micro-framework that allows you to rapidly develop websites in Clojure. … Noir uses Hiccup to generate HTML. … Noir is built on top of Ring and Compojure, which take care of handling HTTP requests and responses.

Advertisements

On Types [and Clojure seq]

Interesting essay on the meaning of (seq …)

http://kotka.de/blog/2011/06/On_types.html

The work horse in the very low-level code of the sequence library is the lazy-seqmacro. It returns an instance of class clojure.lang.LazySeq which encapsulates the abstract instructions to realise the actual sequence according to the body of the lazy-seq macro.

Should this class implement the clojure.lang.ISeq interface?

Rich Hickey Q&A in Code Quarterly

Excellent interview:

Rich Hickey Q&A

by Michael Fogus

Some highlights:

Fogus: Clojure’s threaded concurrency story is very solid with numerous flavors of reference types providing different usage scenarios. Do you feel satisfied with Clojure’s current concurrency offerings, or do you have plans to expand on the current reference model, or perhaps venture into distributed concurrency?
Hickey: Over time I’ve come to see this as more of a state/identity/value/time/process thing rather than concurrency in and of itself. Obviously it matters greatly for concurrent programs. I think there is room for at least one more reference type. To the extent one value is produced from another via a transient process, you could have a construct that allowed that process to have extent and/or multiple participants. This is the kind of thing people do on an ad hoc basis with locks, and could be wrapped in a reference-like construct, pods, that would, like the others, automate it, and make it explicit and safe.
I don’t see distributed concurrency as a language thing. In addition, I don’t think most applications are well served with directly connected distributed objects, but would be better off with some sort of message queues instead.
Fogus: While there are also primitives supporting parallelism, Clojure’s story here has a lot of room for expansion. Do you plan to include higher-level parallel libraries such as those for fork-join or dataflow?
Hickey: Yes, there are plans, and some implementation work, to support fork-join–based parallel map/reduce/filter etc. on the existing data structures.
Read the whole thing.

Simple Thrift in Clojure

http://thecomputersarewinning.com/post/simple-thrift-in-clojure

Thrift provides some nice features such as client and server implementations (not just serialization), support for richer datastructures, and Javascript bindings. Despite these advantages, it can be a pain to figure out how to use Thrift because of spotty documentation.
To that end, I’ve just created an extremely simple wrapper library and example that demonstrates how to use Thrift in clojure.