What Is Clojure?
Clojure is a dynamic, functional programming language created by Rich Hickey, first released in 2007. It is a dialect of Lisp designed to run on the Java Virtual Machine (JVM), giving it direct access to the vast ecosystem of Java libraries while offering a radically different programming model built around immutable data structures and functional purity.
Cricket analogy: Just as Sachin Tendulkar built his batting technique on classical fundamentals while adapting to modern T20 demands, Rich Hickey built Clojure in 2007 on the decades-old foundations of Lisp while adapting it for the modern JVM ecosystem.
A Lisp Dialect on the JVM
Clojure inherits Lisp's signature syntax — code written as nested parenthesized lists called s-expressions — where the first element of a list is typically a function or macro and the rest are its arguments, e.g. (+ 1 2 3). Because Clojure compiles to JVM bytecode, Clojure programs can call Java methods directly, use Java classes, and be deployed anywhere the JVM runs, from servers to Android.
Cricket analogy: Reading an s-expression like (+ 1 2 3) is like reading a scorecard entry that always lists the bowler before the runs conceded — once you learn that fixed order, you can parse any delivery, the same way Clojure, compiling to the same bytecode as Java, can play on any JVM-built ground.
Immutability and Functional Programming
Unlike Java or Python, Clojure's core data structures — lists, vectors, maps, and sets — are immutable by default: operations that appear to 'modify' a collection actually return a new collection, leaving the original untouched. This eliminates a huge class of bugs caused by shared mutable state, and makes Clojure a natural fit for concurrent and multi-threaded programs.
Cricket analogy: Clojure's immutable vector is like an official Cricinfo scorecard for a completed match — once Root's century is recorded, the original scorecard never changes; if you want an updated version, say correcting a boundary count, Cricinfo publishes a new scorecard page, leaving the original archived and intact.
Why Developers Choose Clojure
Clojure is popular for building backend services, data pipelines, and REPL-driven interactive development workflows, particularly at companies that value correctness and rapid iteration, such as Walmart, Nubank, and CircleCI. Its combination of a tiny, stable core language, powerful macros for extending syntax, and seamless Java interop makes it attractive for teams that already run JVM infrastructure but want a more expressive, less error-prone language.
Cricket analogy: Companies adopting Clojure for its small, stable core are like an IPL franchise building around a compact, disciplined bowling attack rather than expensive stars — Nubank and Walmart bet on Clojure's minimal core language the way Rajasthan Royals bet on unheralded, well-drilled bowlers to win the 2008 title.
;; A simple Clojure program demonstrating immutability
(def numbers [1 2 3 4 5])
(defn sum-of-squares [coll]
(reduce + (map #(* % %) coll)))
(println "Original vector:" numbers)
(println "Sum of squares:" (sum-of-squares numbers))
;; => Original vector: [1 2 3 4 5]
;; => Sum of squares: 55
;; numbers itself is never mutated by map or reduce
(println "Still original:" numbers)Clojure's creator, Rich Hickey, laid out much of the language's philosophy in his influential 2011 talk 'Simple Made Easy,' arguing that software complexity often comes from unnecessary complecting of independent concerns — a principle that directly motivated Clojure's emphasis on immutable data and small, composable functions.
- Clojure was created by Rich Hickey and first released in 2007.
- It is a dialect of Lisp that runs on the Java Virtual Machine (JVM).
- Code is written as s-expressions — nested parenthesized lists where the first element is a function or macro.
- Clojure's core data structures are immutable by default, reducing bugs from shared mutable state.
- Clojure interoperates directly with Java, giving access to the entire Java ecosystem.
- Companies like Walmart, Nubank, and CircleCI use Clojure for backend and data systems.
- Clojure emphasizes a small, stable core language extended through macros rather than built-in special syntax.
Practice what you learned
1. Who created Clojure and in what year was it first released?
2. What underlying platform does Clojure primarily run on?
3. Which statement best describes Clojure's core data structures?
4. What is an s-expression in Clojure?
5. Why do many JVM-invested companies adopt Clojure?
Was this page helpful?
You May Also Like
Installing Clojure and Leiningen
A step-by-step guide to setting up a working Clojure development environment, including the JDK, the Clojure CLI tools, and Leiningen.
Clojure Syntax Basics
A tour of Clojure's core syntax: s-expressions, literal data types, the four collection types, and how to define values and functions.
The REPL and Forms
How Clojure's Read-Eval-Print Loop works, how forms are evaluated, and why REPL-driven development is central to the Clojure workflow.
Related Reading
Related Study Notes in Programming
Browse all study notesApache Spark Study Notes
Programming · 30 topics
ProgrammingApache Flink Study Notes
Programming · 30 topics
ProgrammingHadoop Study Notes
Programming · 30 topics
ProgrammingSnowflake Study Notes
Programming · 30 topics
ProgrammingApache Airflow Study Notes
Programming · 30 topics
Programmingdbt (Data Build Tool) Study Notes
Programming · 30 topics