Nvim
Elixir vs Python
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
Most Liked
hauleth
Python
Advantages
- more lightweight VM
- more broad distribution
- “easier deployment”
- broader area of usage (DevOps, Science Computations, scripting, etc.)
- multiple popular VM implementations (CPython, PyPy, Jython, IronPython, etc.)
- mutable types
Disadvantages
- GIL in some implementations
- distributed computation more complicated
- mutable types
- monkey patching (not that it is not possible in Erlang)
Erlang and Elixir
Advantages
- very good distributed primitives
- immutable types
- simple syntax (in case of Erlang)
- powerful syntax (in case of Elixir)
- one VM can easily host different languages (Gleam, Elixir, Erlang, LFE, Joxa, Erlog, Luerl, etc.)
- error handling
- live updates
Disadvantages
- immutability
- without HiPE the performance is often worse than Python
- less familiar syntax (in case of Erlang)
- macros can be confusing (in case of Elixir)
- single popular VM implementation
peerreynders
Python has caught up to Java in terms of popularity. I suspect this is largely due to the fact that typically development in Python is faster than in Java. The fact that it tends to be slower at run-time tends to be a non-issue in most cases.
Python is also easier to learn for non-programmers (while still remaining in the imperative paradigm which many feel is more “natural”) - so it tends to be the weapon of choice of domain experts having to automate stuff (which is what programming essentially is). PHP became popular to “quickly whip up a web site” - Python has a similar appeal to “quickly whip up a program/script”.
(Having said that I suspect that if the JavaScript ecosystem didn’t exist to sink a lot of “developer hate”, Python would be receiving it instead.)
Aside: mozilla.org: Bedrock is a Django Project
Python has positioned itself in the cloud space as a “productive” language - i.e. faster development times than with C, C++, C#, Go, Java, Kotlin etc. (while at the same time not being JavaScript). The tradeoff is that you may require more computational resources at runtime than for a compiled language. Truth is - if your service is profitable enough most businesses don’t care that they could lower the operational cost because they view the gain of efficiency as marginal compared to the perceived cost of (re)development.
For example look at this case:
Summary: Ignore Python at your own peril (try to be a Language Agnostic).
Phillipp
I don’t think it makes that much sense to compare them as their are very different and they are also used differently. But both can be used for web development, that is for sure.
Python is really strong in the ML/AI stuff, mainly because most of the tooling is written in Python. Probably to keep it very beginner friendly.
peerreynders
On a node with Xeon Phi (up to 72 cores) I’d much rather use a BEAM language because concurrent programming is much more natural with BEAM processes (I’d assume there is lots of opportunity for concurrency for the task at hand if you are using hardware like that in the first place).
The other extreme is lower-end hardware like what you are likely to encounter in the IoT space because the BEAM creates opportunities in terms getting the most out of your hardware via pre-emptively scheduled concurrent processes and failure resiliency via supervision trees (and possibly redundant (yet still inexpensive) hardware).
dogweather
I stumbled on a surprising instance of Elixir being much easier to learn and use than Python: I was in each one’s REPL, comparing how to do some typical programming task. (I forget exactly, but it might have been JSON parsing.)
The function in each language was easy to call. And in Elixir, the REPL printed out the data structure result, and I could see exactly how it parsed the string.
Python, however, is object-oriented. And so it gave me a single result object. But the author of that class hadn’t written a __str__ method. And so the REPL couldn’t show me the data, and only produced the unhelpful default representation like <JSONResult #12682362>. In order to actually see the result, I’d need to consult the documentation/API and learn what methods I needed to use to extract the info. And then use them precisely as intended, and hope they work as documented. (Sometimes they don’t.)
But at that point, this was an epiphany. I stopped playing with Python and continued using Elixir. In Elixir, your data is simply right there.







