Clojure is a programming language created by Rich Hickey and released publicly in 2007. According to the language’s own design rationale, Hickey wanted “a Lisp for Functional Programming symbiotic with an established Platform designed for Concurrency,” and Clojure is the result: a dialect of Lisp that compiles to and runs on the Java Virtual Machine, giving it access to the JVM’s libraries, performance, and tooling.
Like other Lisps, Clojure represents code as data made of nested lists and other literal forms, which makes it homoiconic and gives it a powerful macro system. Where it departs sharply from older Lisps is in its treatment of data: the rationale notes that Clojure “defaults to immutability” and that all of its core data structures are “immutable & persistent.” Persistent structures share their internal storage so that producing a modified version is cheap without altering the original.
Clojure separates the idea of a value from the idea of identity and state. Its page on state defines a value as “something that doesn’t change,” an identity as “a stable logical entity associated with a series of different values over time,” and state as the value currently associated with an identity. Reference types such as refs and agents are the managed places where state changes happen, and coordinated changes to refs occur within transactions, so that updates are consistent without manual locking.
This combination of immutable data and explicit, controlled state has made Clojure popular for concurrent and data-oriented programming. The language hosts on the JVM but has also been ported to other runtimes, including JavaScript through ClojureScript.