25 ms·
Though people use Clojure for real work (just like PHP, Perl, Bash or Fortran), it has a narrow ideological focus which is radically different from the multi-pa
by kazinator 6y ago
Though people use Clojure for real work (just like PHP, Perl, Bash or Fortran), it has a narrow ideological focus which is radically different from the multi-paradigm nature of historic Lisps. It can be described as a domain-specific language for processing several kinds of immutable data structures as generic sequences, with Lisp-like syntax and meta-programming. You may learn something about Lisp from Clojure, but the big picture is missing; Clojure is "its own thing", mostly disconnected from the Lisp history, culture and practices. Clojure expertise will not transfer well to Lisp and vice versa.
- jnxx 6y agoClojure with its focus on immutability and its purely functional data structures makes it much easier to write correct concurrent programs. It is clearly geared to servers, for example sequences are always lazy. This is not always the best thing but for servers, it seems in general better. However, there is a subtle point about parallelism: One typically wants concurrency and parallelism for one of three objectives: 1. Concurrency in servers 2. Graphical user interfaces 3. exploiting many cores for complex parallel computations, like number crunching It turns out that Clojure is great for the first application. It also works for the second one. However it is not that great for the third area of interest. The reason is performance. For example, floating point numbers passed in function arguments are often boxed. Also, due to the JVM it is not possible to pass even small objects by value. These things put a lot of pressure on the garbage collector, even if the Clojure compiler partially tries to work around this. And the result of that is that a single-threaded program which does things like massive number crunching written in Common Lisp will be faster than a parallel program written in Clojure. But I still think that immutability in-the-large is the right way to go.