# Elixir vs Python

**URL:** <https://forum.elixirforum.com/t/elixir-vs-python/25619>\
**Category:** Discussions\
**Tags:** discussion, python, elixir\
**Created:** [September 24, 2019, 11:32am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619 "2019-09-24T11:32:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nvim](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/f14d63/32.png) [@Nvim](https://forum.elixirforum.com/u/Nvim)\
**Post date:** [September 24, 2019, 11:32am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/1 "2019-09-24T11:32:55Z")

</div>

Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?

---

<div class="post-metadata">

**Author:** ![Phillipp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/phillipp/32/10625_2.png) [@Phillipp](https://forum.elixirforum.com/u/Phillipp)\
**Post date:** [September 24, 2019, 11:41am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/2 "2019-09-24T11:41:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nvim](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/f14d63/32.png) [@Nvim](https://forum.elixirforum.com/u/Nvim)\
**Post date:** [September 24, 2019, 11:48am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/3 "2019-09-24T11:48:44Z")

</div>

@Phillipp I’m comparing just the languages minus the ecosystem.

---

<div class="post-metadata">

**Author:** ![Phillipp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/phillipp/32/10625_2.png) [@Phillipp](https://forum.elixirforum.com/u/Phillipp)\
**Post date:** [September 24, 2019, 11:51am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/4 "2019-09-24T11:51:16Z")

</div>

For what reason? What do you expect from that? They are not even close to each other. It’s like comparing a car to a bicycle.

---

<div class="post-metadata">

**Author:** ![Nvim](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/f14d63/32.png) [@Nvim](https://forum.elixirforum.com/u/Nvim)\
**Post date:** [September 24, 2019, 11:55am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/5 "2019-09-24T11:55:29Z")

</div>

ok thanks for your input. But I’m still waiting for others take on this matter.

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [September 24, 2019, 12:09pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/6 "2019-09-24T12:09:39Z")

</div>

# 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

---

<div class="post-metadata">

**Author:** ![mkunikow](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mkunikow/32/235_2.png) [@mkunikow](https://forum.elixirforum.com/u/mkunikow)\
**Post date:** [September 24, 2019, 12:11pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/7 "2019-09-24T12:11:09Z")

</div>

I think you can’t compare langues without context there are used for.  
O’Reilly Radar: Open Source Technology Trends - Roger Magoulas (O’Reilly Media)  
OSCON proposals  
Text Anastasis of All Sessions Proposals

```
Next Architecture / Cloud Native
Data
Community
ML/AI
Languages (are only for support role for points above )

```

[![](https://img.youtube.com/vi/jtARZe1ioJU/maxresdefault.jpg "O’Reilly Radar: Open Source Technology Trends - Roger Magoulas (O'Reilly Media)") ](https://www.youtube.com/watch?v=jtARZe1ioJU)

---

<div class="post-metadata">

**Author:** ![andre1sk](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/andre1sk/32/1380_2.png) [@andre1sk](https://forum.elixirforum.com/u/andre1sk)\
**Post date:** [September 24, 2019, 12:42pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/8 "2019-09-24T12:42:56Z")

</div>

It all depends on the context. Project, team, budget etc.

---

<div class="post-metadata">

**Author:** ![Nvim](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/f14d63/32.png) [@Nvim](https://forum.elixirforum.com/u/Nvim)\
**Post date:** [September 24, 2019, 12:49pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/9 "2019-09-24T12:49:39Z")

</div>

best reply yet to this issue straight to the point.

---

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [September 24, 2019, 1:40pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/10 "2019-09-24T13:40:51Z")

</div>

[https://trends.google.com/trends/explore?q=%2Fm%2F07sbkfb,%2Fm%2F02p97,%2Fm%2F05z1\_,%2Fm%2F07657k,%2Fm%2F060kv](https://trends.google.com/trends/explore?q=%2Fm%2F07sbkfb,%2Fm%2F02p97,%2Fm%2F05z1_,%2Fm%2F07657k,%2Fm%2F060kv)

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](http://mozilla.org): [Bedrock is a Django Project](https://github.com/mozilla/bedrock#user-content-bedrock)

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:

> **[The boring technology behind a one-person Internet company](https://www.listennotes.com/blog/the-boring-technology-behind-a-one-person-23/)**
>
> The tech stack of Listen Notes, the best podcast search engine and database.

Summary: Ignore Python at your own peril (try to be a [Language Agnostic](http://web.archive.org/web/20160806005240/http://c2.com/cgi/wiki?LanguageAgnostic)).

---

<div class="post-metadata">

**Author:** ![mythicalprogrammer](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mythicalprogrammer/32/10430_2.png) [@mythicalprogrammer](https://forum.elixirforum.com/u/mythicalprogrammer)\
**Post date:** [September 24, 2019, 2:46pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/11 "2019-09-24T14:46:21Z")

</div>

Python is much numerically faster than Elixir and Erlang.

Try doing the Euler challenge. I’ve tried doing a prime number sieve for one of the problem in Erlang and it’s much slower than Python.

But I agree with the other poster. I think you should define what you are trying to solve first and then figure out which of the two languages are best suited for the task.

---

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [September 24, 2019, 3:22pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/12 "2019-09-24T15:22:13Z")

</div>

> [@mythicalprogrammer](#):
>
> I’ve tried doing a prime number sieve for one of the problem in Erlang and it’s much slower than Python.

On a node with [Xeon Phi](https://ark.intel.com/content/www/us/en/ark/products/95830/intel-xeon-phi-processor-7290-16gb-1-50-ghz-72-core.html) (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).

---

<div class="post-metadata">

**Author:** ![mkunikow](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mkunikow/32/235_2.png) [@mkunikow](https://forum.elixirforum.com/u/mkunikow)\
**Post date:** [September 24, 2019, 3:41pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/13 "2019-09-24T15:41:58Z")

</div>

> [@mythicalprogrammer](#):
>
> Python is much numerically faster than Elixir and Erlang.

It is faster as python is using libraries written in native code.  
For example you have [Download Anaconda Distribution | Anaconda](https://www.anaconda.com/distribution/)

---

<div class="post-metadata">

**Author:** ![mythicalprogrammer](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mythicalprogrammer/32/10430_2.png) [@mythicalprogrammer](https://forum.elixirforum.com/u/mythicalprogrammer)\
**Post date:** [September 24, 2019, 3:46pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/14 "2019-09-24T15:46:42Z")

</div>

OP stated he didn’t want to talk about libraries so I was referring to just the language themselves.

I’d love to be proven wrong but I’ve done Project Euler in both languages with no libraries. From my experiences and what I’ve read Elixir/Erlang is much slower than Python.

But I do understand your statement about Python’s libraries are implemented in faster language. I’ve use a lot of R libraries and they are implemented in C++ and Fortran mostly. It’s very much a glue language.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [September 24, 2019, 3:56pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/15 "2019-09-24T15:56:45Z")

</div>

> [@hauleth](#):
>
> - single popular VM implementation

Truthfully, I see this is an advantage. I come from C and C++. And also from Java and Ruby way before their runtimes were actually as good as they are today. Having multiple community efforts on a runtime/VM was more like a “oh, hell, here we go again” moment once somebody reported a bug. It wasn’t a welcome feature. You had to cater to numerous quirks.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [September 24, 2019, 3:59pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/16 "2019-09-24T15:59:13Z")

</div>

> [@Nvim](#):
>
> I’m comparing just the languages minus the ecosystem.

Even Erlang/Elixir’s OTP and Python’s `numpy`, both very signature technologies, are libraries and not language features or syntax. It’s unimaginable to have Erlang/Elixir without OTP and Python without `numpy`.

In terms of comparing the languages themselves, I’d say this discussion could just spiral to the imperative/OOP vs. functional languages dispute.

---

<div class="post-metadata">

**Author:** ![mythicalprogrammer](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mythicalprogrammer/32/10430_2.png) [@mythicalprogrammer](https://forum.elixirforum.com/u/mythicalprogrammer)\
**Post date:** [September 25, 2019, 5:29am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/17 "2019-09-25T05:29:28Z")

</div>

You are correct if there exist a concurrent solution to the problem and there is enough data to overcome the cache latency/cache coherency due to mulitcore then Erlang/Elixir is faster.

For project Euler I only used iterative solutions and project Euler may not be representative of real world problems.

---

<div class="post-metadata">

**Author:** ![preciz](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/preciz/32/41086_2.png) [@preciz](https://forum.elixirforum.com/u/preciz)\
**Post date:** [September 25, 2019, 8:15am UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/18 "2019-09-25T08:15:40Z")

</div>

![](https://img.youtube.com/vi/J6XcP4JOHmk/maxresdefault.jpg)https://www.youtube.com/embed/J6XcP4JOHmk?feature=oembed&wmode=opaque&start=4420

Here Jeremy Howard ([fast.ai](https://www.fast.ai)) discusses python and machine learning.  
Actually he wants things to move from python to other languages (Swift) and he don’t think python is great.

Probably there are “network effects” in the play here. Some languages don’t have bigger communities because they are better to work with in my opinion. Big companies also play a role.

For me Elixir feels right, Python don’t. This is my opinion.

---

<div class="post-metadata">

**Author:** ![lawik](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lawik/32/32028_2.png) [@lawik](https://forum.elixirforum.com/u/lawik)\
**Post date:** [January 7, 2020, 8:07pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/20 "2020-01-07T20:07:11Z")

</div>

If I would exclude the ecosystem I would still prefer Python for a bundle of cases. Off of the top of my head I’d prefer it for scripting, especially for simple state-heavy scripts where the formalities of immutability would mostly be a hindrance. I largely prefer working with Elixir at this point but I don’t find antagonistically comparing the two to be very useful.

I use both plenty. Ecosystem-wise I see plenty of points to building some things in Django where a batteries-included approach is the best trade-off compared to what I find useful about Phoenix. You get users, login and an admin UI with minimal effort.

Working with Raspberry Pi is significantly easier for quick and dirty things through Python than the more rigorous aporoach of using Nerves. Since that happens to be where the ecosystem lives.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [January 7, 2020, 8:31pm UTC](https://forum.elixirforum.com/t/elixir-vs-python/25619/21 "2020-01-07T20:31:48Z")

</div>

My rule is: script what I need with bash or Ruby to get something done quickly and without ceremony.

But if it grows beyond a certain complexity – usually 300+ lines for bash and 1000+ for Ruby – then I immediately rewrite it in Elixir because I know from practice that I’ll have an easier time maintaining something bigger if it’s in Elixir.

I agree with you that we shouldn’t be antagonistic. A lot of tech has its place.

[Next page](https://forum.elixirforum.com/t/elixir-vs-python/25619.md?page=2)
