>>2676>>2677>>2678>clojure vs scheme/common lisp
RH goes over that in this talk:>>2664
TLDR: rich hickley was a professional programmer who wrote java, c++, and common lisp.
Part of the reason he wrote clojure was because he kept trying to sell his corporate clients on common lisp programs and they absolutely refused to accept it because it wasn't on a 'blessed corporate' platform. So he wrote it on the JVM to both have access to the huge amount of Java libs (clojure has the most libraries of any language because it has all of javas + its own) as well as be more accepted in the mainstream world of corporate programming.
Another difference between something like common lisp/scheme and clojure is that CL/S are multi paradigm. Clojure is a much smaller language because its mainly functional/FP, with immutable (and sometimes lazy) data/structures by default.
Another difference is that clojure uses different data structures underneath the hood, a lot of practical day to day clojure is based on assoc-ing and dissoc-ing things in and out of hash maps rather than consing stuff. Hickley's data structures for clojure are slight modifications of those of the late computer scientist and functional programming researcher Phil Bagwell:https://www.lightbend.com/blog/rip-phil-bagwell
CL uses alot more lists comparatively and in RH's opinion lists are bad data structures because they're slow / O(n) [i agree on this part]
almost everything in clojure is a map, sequence, vector or lazy sequence, all immutable for the most part
Clojure's concurrent programming support is where it really shines though, with stuff like core.async. RH is someone who spent his career writing tons of concurrent systems in C++, so his concurrency primitives are top notch and baked into the language at a core levelhttps://www.braveclojure.com/core-async/
The disadvantages compared to for example common lisp?
Debugging is not as good, instead you get a jvm stack trace
if you want OOP you have to really hack it together since clojure really steers you hard into FP only paradigm
No tail call optimization -> this is the fault of the JVM not RH, the jvm does not support optimized tail calls but you can still do it explicitly using loop/recur, however its not just built into functions normally
Finally, common lisp is an open standard (like the C++ of lisps), while Clojure is like the java of lisps, having not a standard but a reference implementation on the jvm with Rich Hickley as the "benevolent dictator for life"
This is kindof overlooked a lot but clojure has something like 14 primitives -> its an extremely simple language to learn and start writing, and a way more accessible intro to functional programming than something like Haskell for example with its ornate type system. It's the python of functional programming. its also fun to write