sashaafm
Most Liked Responses
shanekilkelly
[warning, a bit ranty]
Let’s put it this way:
I’ve been doing Clojure as a hobbiest for about four years now, and learning Elixir at a beginner level right now, and I already prefer Elixir over Clojure.
Clojure upsides:
- it’s a modern lisp
- the JVM platform is fast
- the language design is generally well thought out
Clojure downsides:
- the “java layer” pokes through far too much, and unlike Elixir/Erlang the underlying Java idioms do not interact well with the functional-programming paradigm of clojure.
- documentation is pretty bad, and remains bad after years of badness (Elixir docs, even for community libs, are much better)
- as a side-effect of poor documentation: there’s often not a coherent story on “how to achieve $FOO” with Clojure. My most recent example was trying to figure out how to build pervasively-non-blocking and highly parallel http services in Clojure. I’m sure it can be done, but it’s very hard to figure out what will work.
- the build tool (leiningen) kinda sucks
- JVM startup time is torturous, by comparison iex/elixir starts almost instantly
And perhaps the biggest problem I’ve found: the core Clojure community is made up mostly of “90’s Java Guys” who wanted to work with a more sane language on the JVM. The rest of the community is FP enthusiasts who aren’t particularly invested in the JVM. In my opinion the first group end up dominating the culture too much. As a result of this, making anything bigger than a toy example app in Clojure involves getting your hands dirty with awful Java libraries. One minute you’re happily coding along in Functional Land, the next you’re digging around in the OOP, mutable-state muck of Java Land again. (see: https://twitter.com/shanekilkelly/status/703297846401957889).
This is a decent value proposition if you’re already financially/professionally/emotionally invested in Java, but for the rest of us it’s a painful experience best avoided.
Elixir, by comparison, doesn’t seem to suffer from the same impedance-mismatch with it’s host platform, which makes me a lot happier instantaneously. That and the fact Elixir has a coherent narrative when it comes to scalable computing, it’s looking like I’ll be investing more of my time in Elixir than Clojure.
EDIT: I decided this post was a bit too negative, so I’ll expand on some of the positive aspects of Elixir, from my point of view.
Elixir upsides:
- very good documentation and on-boarding material (especially considering the size of the community)
- a better approach to namespacing/modules (clojure chucks a huge number of functions into the global namespace, while Elixir prefers to put ‘default’ functions in modules like Enum)
- a coherent vision for massively parallel and distributed computing and the multi-core future
- the Elixir devs and community seem to really care about code ergonomics
- the BEAM is an awesome piece of technology
- mix, and the general ecosystem of tools around Elixir, seem very nice and pleasant to work with
rvirding
Not quite as ports make the outside world look like a “process”. You communicate with it using messages as you would with any other erlang/elixir process. You are even linked to it. In this sense interacting with the outside world through ports is very clean, or at least very erlangy/elixiry.
Robert
gregvaughn
I was paid to work in Clojure for about 9 months, and now I’ve been paid to work in Elixir for 10 months. Here’s a few points to consider.
-
Syntax: Do you love to be hands on with the lisp AST? I tried really hard to like it, but I found it hard to skim unfamiliar Clojure code and get a high-level gist of what’s going on. I really had to read it carefully statement by statement to understand it because it lacks higher level syntactic signposts. Elixir offers those signposts, plus a macro system that is just as powerful. The only tradeoff is that Elixir macros are not as “natural” because it’s not fully homoiconic. I’m fine with that. Others aren’t.
-
Built in Libraries: I found Clojure to have a very broad standard library. There are many specialized higher-order-functions for what seem like rare situations to me. If you know the library well, you can probably use one of these to create all sorts of elegant one liners – and make it harder for the maintenance programmer to reason about. Elixir, in contrast, says “no” to a lot of proposals to add things to the standard library especially when they can be expressed in 2 or 3 lines of existing functions.
-
The VM/ecosystem: JVM has a larger set of libraries. It also lacks the memory isolation to do proper supervision/fault-tolerance the BEAM can do. Interacting with Java libraries from Clojure was more awkward because of the imperative/functional mismatch than interacting with Erlang libraries from Elixir, which are both functional/immutable.








