Clojure is a dialect of Lisp that has attracted a following among programmers who want to adopt a functional approach. Version 1.6 introduces new and improved features, enhancements to performance, printing, documentation strings and error message plus bug fixes.
According to the description on clojure.org:
It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. [It] shares with Lisp the code-as-data philosophy and a powerful macro system, is predominantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs.
The new release provides a Java API consisting of:
This provides a minimal interface to bootstrap Clojure access from other JVM languages. It does this by providing: the ability to use Clojure's namespaces to locate an arbitrary var, returning the var's clojure.lang.IFn interface and a method read for reading data using Clojure's edn reader. IFns provide complete access to Clojure's APIs. You can also access any other library written in Clojure, after adding either its source or compiled form to the classpath.
It provides new hashing algorithms for primitives and collections, accessible via IHashEq/hasheq (in Java) or the clojure.core/hash function (in Clojure). In general, these changes should be transparent to users, except hash codes used inside hashed collections like maps and sets will have better properties.
It also introduces "some" operations, conditional functions that complement true and false when what you want to test is "not nilness".Three functions have been added:
- some? - same as (not (nil? x))
- if-some - like if-let, but checks (some? test) instead of test
- when-some - like when-let, but checks (some? test) instead of test
An update to map destructuring with :keys and :syms mot allow them to match namespaced keys and bind to a local variable based on its name.
The update to Clojure is welcome but introduction of Java 8 and is support for lambdas has provoked one or two programmers to wonder if Clojure is a good option any more. Of course it is if you are looking for a very dynamic functional language Clojure is still a good choice but it you previously were just a little irritated by the Java's support for some feature or another then perhaps its time to stick with Java 8.
SQL Server on Linux, Love or Calculated Move?
Five years ago, who would have imagined Microsoft's U-turn into the arms of Linux arms, especially after Microsoft referred to Linux and Open Source being synonymous with cancer? Last week it joined t [ ... ]
Kotlin 1.05 Released
A new version of Kotlin, the language created by JetBrains, has just been released. Kotlin is another Java replacement and it claims, or rather aims, to be better while fully interoperable.