Hacker News new | past | comments | ask | show | jobs | submit login

Language intricacies aside, is there a reason to use Clojure over Elixir, Erlang? Genuinely curious what JVM has to offer vs BEAM / OTP if you're going to use dynamic languages.



Clojure's version of immutability is more useful in some domains than Elixir/Erlang's. E.g. you can both safely and efficiently share memory in Clojure across multiple threads. You can't really do the same in Elixir that I'm aware of - it triggers a deep copy which can kill performance. Sometimes acceptable, sometimes not.

Elixir/Erlang processes serve a lot of roles. If those roles don't line up cleanly your code could end up a lot more complex than necessary in other languages.

In the past the JVM had better raw performance, but I'm not sure how much that might change with the new JIT in BEAM.


There is this interesting thread over in reddit about it: https://www.reddit.com/r/Clojure/comments/5q2gmi/convince_me...


Thanks! Although I don't agree with all of the points, it was a good read.


The JVM ecosystem is many orders of magnitude larger than than BEAM/OTP.

For example, you can usually find an API library for Java even from small vendors. I don’t think I’ve seen any vendor provide an Erlang API library.


Basho did for Riak, but that might be due to the fact that Riak was written in Erlang...


Practicality. Most of language "comparison" discussions miss out on the practicality aspect: does it work, does it have a good runtime (both true for Elixir and Erlang), can you write code that runs both client-side and server-side, are there good abstractions and libraries for many programming models, is it being actively maintained and developed?

Clojure ticks all of those and more, while most superficial comparisons concentrate on superficial aspects.


It has really good monitoring, profiling, interop tooling. Both JITCs it has (C2 and Graal) are very good at and optimised for compiling dynamic languages.

Also the recent JVMs have GCs that can collect enormous heaps without stuttering of any kind.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: