Welcome to another issue of Clojure weekly, my small routinely contribution to the Clojure sphere! I was somehow longer commenting this time, but normally these are just a few links pointing at articles, documentation, screencasts, podcasts or anything else that attracts my attention. That’s it, enjoy!
Episode 5 – Colin JonesFunctional Geekery | Functional Geekery Here’s another episode from the Functional Geekery series that I like. A few things I didn’t know about Colin Jones: he’s the creator of Clojure Koans and REPL-y, the REPL I use every time I type lein repl (that is every day). I think the episode gives you an example of a successful path to “Clojure enlightenment” through some of the craftsmanship principles: Colin (who’s not coming from a programming background) used clojure koans as a learning tool as well as providing the rest of the community with a great learning resource. REPL-y is a simple contributions that makes a lot of difference in everyday programming. He did not stop at Clojure: learning other FP languages (like Haskell) will give you part of the background to understand Clojure (Rich Hickey borrowed from Haskell as well as many other interesting languages while designing Clojure). He’s working on another great contribution, co-authoring a book on macros for Pragmatic Press. Overall a pleasant listening with many episodes links to follow right after.
Official Ring Repositories The ring family contains the core (linked here), a few middleware (inside the ring repo) and the Jetty adapter. But it makes much more sense when you also add the lein-ring plugin (for dev) which in turns uses the ring-server (also for dev) which in turns deploys everything on the embedded jetty-adapter. You just want to add Compojure on top, because without routing macros it could end up in a giant mess. The ring middleware modelling of requests and responses is a simple concept. Less simple is to understand how all of the above small pieces collaborate together. The good news is that you don’t need to know (most of the cases). But just in case you are wondering what are we dealing with, I think the Ring family can be described roughly as a Clojure layer on top of the Java Servlet API (and Jetty embedded APIs if you don’t deploy a war) that gets translated into a set of Servlet Filters, Servlet mappings and configuration (programmatic or xml). I think the tendency of describing the Clojure web app approach as a set of isolated small pieces derives mainly from how Ring was laid out in the first place.
jpalardy/vim-slime Here’s what happens when you look around other editors and see what you like and what you don’t. Emacs Cider better integration prompted some searching about how to evaluate code without copy paste into a proper REPL. I’m used to have a tmux pane opened with a lein repl running, so vim-slime seemed a straightforward choice. Now I can ctrl+c+c to send a paragraph for evaluation to the live REPL hosted in tmux or gnu screen.
Code Quarterly - Rich Hickey interview I found this slightly old (2011) but very good in-depth interview on Clojure and its history from Rich The-Man himself interviewed by Michael Fogus. Here you can learn more about Rich learning, thinking and design process. Rich doesn’t not “exercise” on programming, but rather puts a lot into thinking about programming ahead of the keyboard (and time not spent programming is used to read relentlessly books or academic papers). The discussion moves on to language families, Clojure influences and OOP Classes that Rich compares to having to write each chapter of a book using a different language. As of the history part, Rich was big on C++ and then discovered the flexibility of Lisp, in particular that with Lisp he’s able to write only code that matters achieving great degree of focus. With each of the Clojure predecessor (dotLisp, Foil, and Lisplets), Rich experimented with aspects of writing List targeting an hosting VM.5 days ago