15 ms·
Clojure is not just a Lisp on the JVM. Clojure is a Lisp but also much more: Readable persistent vectors, hash maps, and sets. Protocols, records, and anonymous
by adrianm 10y ago
Clojure is not just a Lisp on the JVM. Clojure is a Lisp but also much more: Readable persistent vectors, hash maps, and sets. Protocols, records, and anonymous (reified) instances of protocols/interfaces. Sequences as a common unifying and extensible abstraction for iteration. Transients, transducers, multimethods with ad-hoc and extensible hierarchies. Namespaces and vars with metadata. Atoms, Agents, Refs, and the STM. Reducers and fork-join. AOT compilation to Java bytecode along with dynamic loading of any code. Now clojure.spec and more, and this is just stuff built into the language.
- pavelludiq 10y agoAll of those could have been and a lot of them are libraries in the CL ecosystem though(with varying degrees of quality unfortunately). I feel the reason clojure is a separate language at all is because it would be pretty hard to get a lot of non-lispers interested in a collection of lisp libraries, while getting them to try a new language especially on a familiar platform is relatively easier, especially if you are a talented speaker like Rich and some of the other early clojure adopters. Other reasons might include the fact that the CL ecosystem in late 10 years ago was light-years behind what it is now. And of course people have an irrational repulsion to some characteristics, like the reader upcasing all symbols by default, which has caused me 0 problems other than the fact that I though it was weird in the beginning. No disrespect to clojure, it probably got a lot of people interested in common lisp and scheme as a result of existing, but that's my view of things.
- idobai 10y ago> Readable persistent vectors, hash maps, and sets. Implementing data structures are revolutionary now?
- lacampbell 10y agoClojure is a Lisp but also much more: Readable persistent vectors, hash maps, and sets. This is kind of oxymoronic - because those things make it less of a lisp. And to be frank, if you don't think (vector 1 2 3) is readable, then I don't think you really get lisp. Protocols A greenspunning of OO features with a different name because Hickey doesn't get OO (probably never made it through to the bit SICP where you implement objects, or read the "closures are a poor mans object" koan). 90% of the rest of what you list can be found in in various lisps - often all in the same place (racket, common lisp).
- iopq 10y agoWhat's the point of objects? I don't find myself needing objects when I code in Rust.
- pjmlp 10y agoSo how do you use Rust without traits?
- iopq 10y agoI use Rust with traits. But I don't have classes or objects.
- pjmlp 10y agoMost of those features were already present in Common Lisp in the mid-80's. The main advantages of Clojure are the libraries from JVM/.NET, having a few parenthesis replaced by square brackets and charismatic community speakers like Rich and David.
- sheepmullet 10y ago> The main advantages of Clojure are the ... I'd argue the main advantage is the consistent focus on making pragmatic engineering decisions and the focus on building a community who are equally pragmatic. I've got a bunch of Clojure apps that I wrote ~5 years ago that still work on the latest version of Clojure with the latest libraries. That is pragmatic engineering. Cursive, the Clojure IDE built on top of IntelliJ, is an amazing bit of work when you consider it is written by one guy. Again the clever use of leverage. A focus on everyday immutability and easily reasoned concurrency makes building and reasoning about medium sized applications much easier. Etc etc. For a language not backed by an industry titan it has done an amazing job. Sure when you look at something like spec there isn't a whole lot of "secret sauce" - almost all of it has been done before (I remember the big Microsoft push for runtime contracts over a decade ago). Despite this I predict it will have a huge impact on overall codebase quality.
- jlarocco 10y agoAs others have mentioned, all of those are in Common Lisp, either built-in or with with libraries readily available in Quicklisp. Quicklisp didn't exist back then, so it wasn't so easy as it is today, but most of the libraries already existed. Don't get me wrong, I understand the convenience of having all of that built in, minus the crusty parts of Common Lisp, but as far as language features go, I'd say it was evolutionary, not revolutionary.