Nvim

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

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
11
Post #6
peerreynders

peerreynders

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: 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

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.

Where Next?

Popular in Discussions Top

jeramyRR
This is an interesting article to read. Elixir’s performance, like usual, is excellent. However, it seems like the high CPU usage is co...
New
blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43591 214
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New

We're in Beta

About us Mission Statement