Clojure Weekly, Jun 16th, 2016
Welcome to another issue of the Clojure Weekly! The Weekly is a collection of bookmarks, normally 4/5, pointing at articles, docs, screencasts, podcasts and anything else that attracts my attention in the clojure-sphere for the last 7 (or so) days. I add a small comment so you can decide if you want to look at the whole thing or not. That’s it, enjoy!
datafun Datafun is an hybrid functional/logic programming language. It follows the principle to add higher order functions on top of Datalog and put everything together into a new language (as opposed for example to Clojure datalog implementation in Clojure). The idea is to extract what makes Datalog expressive into a language with the same characteristics which you can actually program in. The linked page shows some examples of how it looks like. A more formal paper is available at www.cs.bham.ac.uk/~krishnan/datafun.pdf. The linked project is also the Racket implementation of Datafun by the author of the paper.
Clojure spec with Rich Hickey - Cognicast Episode 103 In this Cognicast, Rich iterates through the rationale of core.spec, features and possible uses. Of all the resources out there, this podcast along the official guide are the most authoritative resources about the design and use of core.spec, respectively. I had a look at how it was implemented, skimming briefly through the sources and impressed by the relative simplicity of the solution. At the same time is bringing a lot into Clojure core, since starting from 1.9 you won't need libraries to spec out functions, generate sample data and use generative testing against your code.
A Tool For Thought The community is still absorbing the core.spec news and blog posts are still appearing to try to describe what this is all about. David Nolen introductory post correlates spec with papers and ideas in computer science, coming to the conclusion that this is an optimal tool to achieve crispness in large codebases. It might be a a little too celebratory in the tone, but it contains a nice example of spec-ing out a let form at the end.
Scripts · boot-clj/boot Wiki Boot has a quick way to write an executable Clojure script that doesn't need any "java -jar" if you have boot installed. It includes the possibility to specify dependencies and a main with args parser helper. The main use case here is to put together an executable without necessarily going bash.
What are some uses of Clojure metadata? Right, I was wondering how and when they were used outside from documentation and compiler internals. Clojure metadata is advertised as a public feature not just a compiler helper. There has been some propagation bug in the past, but not enough to justify lack of use of the feature. This Stackoverflow question contains one interesting option to use them at the basis for a "taint" for insecure strings.
My Increasing Frustration With Clojure This article and related Reddit thread are a good description of how the Clojure core team works and what to expect from them. Compared to other languages, Clojure is more conservative and pushes back on issues that some users consider unacceptable. It's true that Clojure has many rough edges and inconsistencies but it's also a remarkably pragmatic language if your main goal is to deliver working code.
Some thoughts on clojure.spec Nice distinction between static typing and contracts and what they can and cannot do. Some (mild) critique about clojure spec in terms of input validation compared to Schema coercions, although it is pretty much possible that the very young Clojure feature will evolve that way eventually.












