Here is a nice example of creating software that simulates a parking garage. Two different examples. If you are learning Clojure this might be of interest to you. In the first example, Clojure Refs are used. The problem is to simulate operations on a garage used for parking vehicles – vehicles come into the parking garage, park and then later leave. They are identified by their license plate number. This is a nice example for those looking for Clojure examples.
In the second example, the same parking garage problem from the previous post is solved using
clojure.spec . See more on the clojure.spec rationale and the guide. Here is the second example which uses Clojure.spec.
Yoav Rubin shows how a change in a common perspective affects the design and implementation of a well-studied type of software: a database. In this excellent examination of how a shift in perspective changes everything, Yoav provides us with a rich examination of what we thought we knew but it turns out that perhaps there are better ways to approach databases. “Database systems are designed to store and query data. This is something that all information workers do; however, the systems themselves were designed by computer scientists. As a result, modern database systems are highly influenced by computer scientists’ definition of what data is, and what can be done with it.
For example, most modern databases implement updates by overwriting old data in-place instead of appending the new data and keeping the old. This mechanism, nicknamed “place-oriented programming” by Rich Hickey, saves storage space but makes it impossible to retrieve the entire history of a particular record. This design decision reflects the computer scientist’s perspective that “history” is less important than the price of its storage.”
As Yoav puts it succintly -If you were to instead ask an archaeologist where the old data can be found, the answer would be “hopefully, it’s just buried underneath”.
Leveraging the richness of the Clojure language and 360 lines of code – we have an “archeology-inspired” database. To read the article, select:
This talk goes through the software stack needed to create a real estate portal. At a high level the presenter provides the initial schedule and how it was met. The use of Clojure and a number of software components and middleware was an integral part of the project.
It certainly worth viewing the presentation by Mohit Thatte as he provides a deep-dive into the Clojure data structures. The video can be found here :
The slides can be found at slideshare.
I’ve been heavily invested in learning and working on Solr deployments and also learning Chef this past few months. More on those technologies is coming shortly.
It is worth reading a Clojure introduction if you are trying to learn Clojure quickly. Here are two quick and useful reads.
Also there is a nice stackoverflow question and answer on learning how to write Clojure web services.
Christophe Grand provides a nice presentation discussing a number aspects of the Clojure language.
Dhruv’s Blog has provided a nice write-up on on building a login form in Clojurescript and Reagent. This is a particularly interesting write-up that goes through the building of a login form in Clojurescript that leverages Ring, Figwheel and Reagent.
Programming languages are tools. Depending on what you are doing the right tool becomes an important choice. When developers move to another programming language – It is worth examining why they moved. In this case from Python to Clojure. In the article he provides a list of why he views the move to Clojure as a good one : immutability, a highly interactive REPL and class loader, better performance, deployment advantages, Java interoperability by virtue that Clojure sits ontop of the JVM, simplicity and wealth of functional programming advantages.
A follow-on read to this is zach charlop-powers blog entry :
One more interesting article on this topic that I ran into :
and the follow-on :
Worth reading. A Clojure style guide.
In a blog post, Rich Hickey introduced transducers. Transducers “are a powerful and composable way to build algorithmic transformations that you can reuse in many contexts”. It is worth reading this two articles :
And if you want more on Clojure transducers, people are already looking at what this means.
and here is a write-up of some some examples :