Clojure will affect the way you think about programming (2017)
In 2007, Clojure emerged as a programming language that combines elements from various existing languages, creating a coherent whole. It is a modern Lisp, built upon recent research in data structures like efficient persistent vectors. Being a Lisp, Clojure emphasizes the importance of full Lisp-style macros and uniform syntax, forcing programmers to think about the meta-circular abstraction where code is treated as data.
This concept revolutionized the way the author approached a performance challenge in Perl, generating and evaluating new code on the fly, which led to a successful outcome.
The designers of Clojure are guided by pragmatism, drawing from decades of industry experience. Rich Hickey, the original designer, is renowned for his insightful talks. One of his most popular quotes is about how simplicity often follows complexity, a principle deeply embedded in Clojure's design.
Clojure excels in processing and extracting information from large datasets, similar to SQL, but it achieves this using built-in tools. Functions in Clojure are built-in and efficient, even allowing for seamless parallelization using Reducers and Transducers. Clojure's clojure.spec library offers type-safety for nested data structures, providing a formal and verifiable way of working with data.
While Clojure is a dynamic language, it also supports optional static checking through core.typed. Historically, Lisp programmers were not big proponents of Object-Oriented Programming (OOP), but Clojure has incorporated powerful OOP-like features. Instead of inheritance hierarchies, Clojure prefers protocols, which encourage thinking in terms of interfaces and multiple dispatch, providing a powerful modeling tool.
Concurrency and parallelism are core aspects of Clojure. As a functional language, it has persistent data structures that are immutable, making them ideal for multi-threaded contexts. This feature solves the problem of copying non-trivial data structures in pure functions, making them more efficient and applicable to a wide range of problems.
Rewritten by urgent.news; may contain errors — check the original.
Source: eli.thegreenplace.net