Nvim

Nvim

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

Showing Posts 30 to 21

brunot-mouan

brunot-mouan

Hi all , In other to works with api like facebook business API for example to interact with their messaging system , which choice could be better between Elixir and Python ? Advantages or Disadvantages ? Your answers will be the most welcome

groundf

groundf

As a long-time Python programmer, I cannot agree more :grin:

Papillon6814

Papillon6814

I often use python as a helper of my phoenix project.
For instance, I wrote a test script for tcp server which is written in elixir.
It is important to think of “when to use python, when to use elixir”, I think :slight_smile: :smiley:

ityonemo

ityonemo

Alright since we’re beating a dead snake here, I absolutely hate how when you install a library it’s unclear where it goes and if you have two packages that require different versions (I’m looking at you, tensorflow) the solution is to create an virtual environment that changes your whole system setup with hidden variables to manage it. Don’t ask what happens when your environment registry gets corrupted (historically at that point I have reinstalled Linux as a solution, but I’m not exactly the smartest)

amnu3387

amnu3387

You also have Erlang’s sys module, so with a pid you can do :sys.get_state(pid) and get the actual state, and there’s other functions in sys. You can also always create a specific handler to handle the state inspection (though both sys and handlers require that the server isn’t blocked doing something).

I have no horse in the race between elixir/erlang and other languages and sometimes I wonder looking at the code why I prefer to work with elixir/erlang - but in the end it boils down to the actual simplicity - once you have in mind the very basic building blocks everything more or less follows the same structure (supervisor, children (which usually have more children), monitor/link, trap exits or listen for down messages, start->do stuff in steps->stop) and extending a gen_server, or gen_statem to handle new cases, new flows and/or new paths is usually pretty trivial in my experience - the same with adding concurrency to it, limiting the concurrency, etc. Lastly usually if you’ve isolated the servers, changing them to a new independent app is a matter of moving the modules and changing a few lines in the supervision trees. To me it just makes sense. Of course, some things are expensive to do in the beam but since I usually don’t need super fast arrays or anything like that where mutability shines, I’m ok with that.

mudasobwa

mudasobwa

Creator of Cure

Well, that is hardly a reason; not implementing Inspect for your own struct in Elixir might result in rather unreadable outcome. Yes, thanks to core team, it’ll be somewhat printed, but the result is also not guaranteed to be comprehensible for deeply nested structs with very long keys.

ityonemo

ityonemo

I was thinking, you can hide your data in Elixir inside of a genserver, but then I remembered you can still see the tail-call state of that genserver with sneakiness =D. I think the only true way to hide yo’ data is to use a resource.

ityonemo

ityonemo

brutal. I just lost a battle at work and won’t be able to update our bff/frontend to elixir from python (our backend is elixir, feels backward somehow). Wish they could understand this, because I have felt this pain so much.

polypush135

polypush135

I will say I hate Python for the single reason that it will blow up with a mix tabs and spaces. I can’t tell you how many times I was working on a file that someone had added a tab in only for it blow up on me with a horrible error that had nothing or little to do with the issue of the whitespace.

dogweather

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.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 92995 915
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
GES233
I’m posting this in response to Jose’s recent tweet (Cr. link) : People are sleeping on Elixir for a coding harness: Hot-code swappi...
New
_mfierro
Hello, I wrote Stop My Hand, a Scattergories-like web application using Phoenix/LiveView as my learning project for Elixir (after readin...
New
nseaSeb
AcmeScript — Writing JS hooks as if I were still using Elixir I’ve been having fun building a little something over the last few days: Ac...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews