Posts

Showing posts with the label Clojure

Clojure Explained: A Modern Lisp on the JVM

Introduction Lisp is the second-oldest programming language still in use, and most programmers have never written it — yet its ideas (code as data, functions as values, macros) shaped everything after it. Clojure, released in 2007, is Lisp rebuilt for the modern world: it runs on the JVM, uses every Java library, and replaces Lisp's mutable lists with immutable data structures. It is the language that convinced a generation of sceptics that parentheses are not a problem — they are the point. Immutable data, code as data, and the REPL Clojure's model rests on a few distinctive ideas: Immutable data by default — maps, vectors, and sets never change in place; "updating" returns a new version, so concurrent code shares data safely and old versions stay available. Code as data — Clojure code is itself a data structure (lists), so programs can manipulate programs: macros, the feature other languages fake with code generation, are native. The REPL — develop interactively:...