-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elixir is harder than you think #215
Comments
The same Jean Klingler did this other one for streams To be tested! |
Respectfully, I reject the "
The data structures / manipulation and dynamic types arguments are a good reason to reach for Chris Ertel's "The Hitchhiker's Guide to Elixir Performance" (linked above) is very insightful. Ultimately, people need to know why they are using Getting started with |
I agree with Nelson here, especially around how it is much easier to write
inefficient JS code than Elixir code.
I also take issue with the notion that Elixir is hard because of the
inefficient way it accesses and manipulates lists. If a beginner somehow
got themselves into a situation in which they actually had a tremendously
long list to sort and search (and they’re not doing it at the database
level for some reason), there are plenty of examples of how to work around
this (e.g.
https://discord.com/blog/using-rust-to-scale-elixir-for-11-million-concurrent-users
)
JS and other langs have way more performance pitfalls, especially around
data marshalling and data transmission — pitfalls that we don’t run into in
Elixirland simply because the BEAM ecosystem is so mature.
IMHO it is also much easier to stand up networked Elixir apps than
standalone Python or C apps… not to mention how easy it is to set up an
Elixir app that can run and supervise Python/Rust/etc apps.
To me Elixir’s strength is in how flippin’ easy it is… as long as you’re
not going crazy with sigils and captures, those will confuse people :P
Cheers,
Nick
…On Tue, Jul 16, 2024 at 12:31 AM Nelson ***@***.***> wrote:
Respectfully, I reject the "Elixir is hard" narrative as FUD
<https://en.wikipedia.org/wiki/Fear,_uncertainty,_and_doubt>. 🙅
Doing *anything* at an *expert* level is harder than most *beginners*
think. 💭
The amount of *horrible* JS code I've read (and had to refactor) over the
years makes me *cry* inside! 😢 ⏳
Newsflash: Go is *always* going to be faster than Elixir on synthetic
benchmarks! 📰
But then you need a whole other infrastructure to *run* and *monitor* the
Go App.
Which requires a DevOps person/team ... 💰
Elixir / Erlang wasn't *made* for manipulating data structures ...
It's like using a hammer to dig a hole; pointless. 🔨 🤦♂️
Erlang (BEAM) bytecode runs in a VM, Go is compiled to a binary.
The data structures / manipulation and dynamic types arguments are a
*good* reason to reach for Zig
<dwyl/learn-zig#1>
Which beats Go in *most* cases:
https://github.com/hanabi1224/Programming-Language-Benchmarks
Specifically: https://programming-language-benchmarks.vercel.app/go-vs-zig
Chris Ertel's "The Hitchhiker's Guide to Elixir Performance" (linked
above) is very insightful.
"*There is no optimization without experimentation*":
image.png (view on web)
<https://github.com/user-attachments/assets/53bc044f-2279-4fe1-a6e1-8d4d5251f76a>
Ultimately, people need to know *why*
<#102> they are using Elixir.
💧 ❤️
It's not for synthetic benchmark performance. 🙅
I see Elixir, Phoenix and LiveView as tools for *rapid* prototyping ideas.
Which can scale to *millions* of concurrent people using, as demonstrated
by WhatsApp and Discord.
.then if there's a specific area of the App that is causing a bottleneck,
it can be re-written *later*!
Getting *started* with Elixir is what matters. 🔰
And for that I find the language is *very* beginner-friendly. 👌
—
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4RWIBSTUDL77IJUEVJC53ZMSO3NAVCNFSM6AAAAABK4ONC4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZHE4TQOBWHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I knew that "hard" would be provocative but I did it is an positive way. I like Elixir. Probably needs a disclaimer. The idea is not to show how bad Elixir is at manipulating data. On the contrary, because you are using a functional language with immutable data, you should be aware of this and challenge yourself - applying this to myself and not spread poor code - and it is shown above that solutions exist, internal or external. |
An open discussion: Elixir maybe harder than you think to get it speedy. It is VERY easy to write "inefficient" code.
Some examples:
The todo:
The first "poor" first "natural" version:
:erlang_disasm.file
and the add-onbeamdasm
if you are very curious.The todo: repeatedly pick a random element from a large list of words
He "solved" the issue of constant time access by using the AJA library
The text was updated successfully, but these errors were encountered: