Need advice about which tool to choose?Ask the StackShare community!
Clojure vs Elixir: What are the differences?
What is Clojure? A dynamic programming language that targets the Java Virtual Machine. Clojure is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a compiled language - it compiles directly to JVM bytecode, yet remains completely dynamic. Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.
What is Elixir? Dynamic, functional language designed for building scalable and maintainable applications. Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain.
Clojure and Elixir can be categorized as "Languages" tools.
"It is a lisp", "Concise syntax" and "Persistent data structures" are the key factors why developers consider Clojure; whereas "Concurrency", "Functional" and "Erlang vm" are the primary reasons why Elixir is favored.
Clojure and Elixir are both open source tools. Elixir with 15.5K GitHub stars and 2.21K forks on GitHub appears to be more popular than Clojure with 7.82K GitHub stars and 1.25K GitHub forks.
According to the StackShare community, Elixir has a broader approval, being mentioned in 175 company stacks & 183 developers stacks; compared to Clojure, which is listed in 95 company stacks and 76 developer stacks.
#rust #elixir So am creating a messenger with voice call capabilities app which the user signs up using phone number and so at first i wanted to use Actix so i learned Rust so i thought to myself because well its first i felt its a bit immature to use actix web even though some companies are using Rust but we cant really say the full potential of Rust in a full scale app for example in Discord both Elixir and Rust are used meaning there is equal need for them but for Elixir so many companies use it from Whatsapp, Wechat, etc and this means something for Rust is not ready to go full scale we cant assume all this possibilities when it come Rust. So i decided to go the Erlang way after alot of Thinking so Do you think i made the right decision?Am 19 year programmer so i assume am not experienced as you so your answer or comment would really valuable to me
We’re a new startup so we need to be able to deliver quick changes as we find our product market fit. We’ve also got to ensure that we’re moving money safely, and keeping perfect records. The technologies we’ve chosen mix mature but well maintained frameworks like Django, with modern web-first and api-first front ends like GraphQL, NextJS, and Chakra. We use a little Golang sparingly in our backend to ensure that when we interact with financial services, we do so with statically compiled, strongly typed, and strictly limited and reviewed code.
You can read all about it in our linked blog post.
We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.
As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:
Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.
PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.
We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.
Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.
Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.
Pros of Clojure
- It is a lisp118
- Persistent data structures101
- Concise syntax100
- jvm-based language90
- Concurrency89
- Interactive repl82
- Code is data76
- Lazy data structures61
- Open source61
- Macros56
- Functional49
- Simplistic22
- Immutable by default22
- Excellent collections19
- Fast-growing community18
- Multiple host languages14
- Practical Lisp14
- Simple (not easy!)14
- Addictive9
- Community9
- Because it's really fun to use9
- Web friendly8
- Rapid development8
- It creates Reusable code8
- Minimalist7
- Java interop6
- Programmable programming language5
- Regained interest in programming4
- Compiles to JavaScript3
- EDN3
- Share a lot of code with clojurescript/use on frontend2
Pros of Elixir
- Concurrency171
- Functional158
- Erlang vm132
- Great documentation111
- Great tooling104
- Immutable data structures84
- Open source79
- Pattern-matching76
- Easy to get started61
- Actor library58
- Functional with a neat syntax30
- Ruby inspired29
- Homoiconic24
- Erlang evolved23
- Beauty of Ruby, Speed of Erlang/C22
- Fault Tolerant17
- Simple14
- High Performance13
- Doc as first class citizen10
- Good lang10
- Pipe Operator9
- Stinkin' fast, no memory leaks, easy on the eyes9
- Resilient to failure7
- Fun to write7
- OTP7
- GenServer takes the guesswork out of background work5
- Not Swift4
- Pattern matching4
- Idempotence4
- Fast, Concurrent with clean error messages4
- Easy to use3
- Dynamic Typing2
- Error isolation2
Sign up to add or upvote prosMake informed product decisions
Cons of Clojure
- Cryptic stacktraces9
- Need to wrap basically every java lib4
- Toxic community4
- Good code heavily relies on local conventions3
- Slow application startup2
- Tonns of abandonware2
- Usable only with REPL1
- Hiring issues1
- Bad documented libs1
- Macros are overused by devs1
- Tricky profiling1
- IDE with high learning curve1
- Configuration bolierplate1
- Conservative community1
- Have no good and fast fmt0
Cons of Elixir
- Fewer jobs for Elixir experts11
- Smaller userbase than other mainstream languages7
- Elixir's dot notation less readable ("object": 1st arg)5
- Dynamic typing4
- Difficult to understand1
- Not a lot of learning books available1