Articles on Clojure

Last updated: 2023/01/09

Top deep-dives on Clojure

What Clojure spec is and what you can do with it (an illustrated guide)

I did some dabbling in Clojure in the past, and found it to be an extremely powerful, albeit initially not a very intuitive language. One of its controversial characteristics is that the type of function parameters and return values isn't enforced. In this in-depth article, Stathis Sideris presents the response to this criticism, which is done in the form of specs. Stathis focuses on two major topics; what is a spec and how can you use it?

Fast and Elegant Clojure

Some say premature optimization is the root of all evil, but that quote is often times taken out of context, because it's actually followed by "Yet we should not pass up our opportunities in that critical 3%". Ben Sless' article was inspired by another post claiming the speed superiority of Common Lisp over Clojure, and in it Ben presents a number of techniques for optimization in Clojure that make the example code run faster than the Common Lisp version.

Clojure Zippers

In programming, a zipper is "a wrapper that offers a variety of data manipulations". But zippers are an abstraction and come with their own complexity. Ivan Grishaev's eight part article traverses the basics of navigation, automatic navigation, XML zippers, XML search, editing, virtual trees, breadth-first traversal, and concludes with a summary.

Abstract Clojure

A lot of the decisions you make in programming can be broken down into is the abstraction easier to maintain than reality? Depending on what your answer is, that's the option you should go with. Alex King's article demonstrates how your code can become more modular through abstractions, implemented in Clojure.

Reflecting on Transducers

Jeremy Steward explains his process of creating a transducer egg (module) for Scheme. Jeremy was motivated to create the egg because they wanted Scheme to have something similar to Rust's iterator trait.
Some highlights:

  • Tranducers are a way to apply a composition of functions to each element in a collection
  • Creating something like a trait in Scheme is difficult, because Scheme is a dynamic language
  • Scheme library authors aren't really helping the idea that lists should only be used in certain circumstances and not all of the time

The Clojure Promise

Although the introduction of the async library has made promises somewhat obsolete, they still might have some niche use cases in Clojure. Gary Verhaegen has written an article that breaks down what a promise is, explores its relation to other languages and other Clojure constructs, and a couple of its uses.


Want to see more in-depth content?

subscribe to my newsletter!

Other Articles