Skip to content
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

Native JSON in OTP 27! (Elixir, Erlang, Gleam) #224

Open
nelsonic opened this issue Jan 2, 2025 · 4 comments
Open

Native JSON in OTP 27! (Elixir, Erlang, Gleam) #224

nelsonic opened this issue Jan 2, 2025 · 4 comments
Labels
discuss Share your constructive thoughts on how to make progress with this issue elixir Pull requests that update Elixir code enhancement New feature or enhancement of existing functionality technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Jan 2, 2025

Native JSON in OTP 27! (Elixir, Erlang, Gleam): https://youtu.be/kqDqSLOuxmM
image

https://github.com/ChristianAlexander/json-otp-27

https://www.erlang.org/doc/apps/stdlib/json.html

This is now included in Elixir 1.18 🚀
which means we can do :json.decode natively without poison or jason. 🎉
My only question is: what took the Erlang/OTP devs so long?! ⏳ (😜)

@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality discuss Share your constructive thoughts on how to make progress with this issue technical A technical issue that requires understanding of the code, infrastructure or dependencies elixir Pull requests that update Elixir code labels Jan 2, 2025
@ndrean
Copy link
Contributor

ndrean commented Jan 4, 2025

My question is: is this faster?

If not, well, it is not because it is easier that it is interesting, modulo a dependency.

Why do I say this? I saw Elixir vs Go, and yes, I believe we can and should compare things . It is easy to say it is not relevant, but why? that there are many of benchmarks out there etc.
Comparing garbage collected and concurrent ready languages for basic stuff makes sense. It shows things. Why so much CPU consumption? Why is the Postgres adaptor performance so poor?

Again, when you look at the resources consumed by Go vs Elixir, and you have to pay for the resources, then you start to think. It seems like only rich people can or should adopt Elixir. Is this unfair?

You can distribute easily etc. Ok, you distribute because you consume so much more? Are you ready to triple you costs because you are not efficient?

Running on a VM. OK, then compare to Java? Will be a gap too.

However, I got afraid when I saw the reactions on Elixirforum. One iodata and things should be solved. They were not. Disappointed, but who cares!

Elixir is more aligned with Python, Ruby.

However, for me, it is one of the best orchestrator out there. Its force is probably to integrate things, running various tasks, which is already not so bad.

Liveview? Nice but the state of each single connection is on the server, so if you are not super cautious, the server will quickly be drowned.

All these are some arguments I heard. It is not because things are easy that people will buy it. People buy speed and efficiency.

@nelsonic
Copy link
Member Author

nelsonic commented Jan 4, 2025

You’d be surprised how many people are oblivious to “speed and efficiency”.”
Or how many companies don’t care about how much they pay in server resources as a percentage of total IT/engineering Costs.
No argument that Go is faster than Elixir. 🙅‍♂️
And in some cases, fewer lines of code.
But have you tried building a full-stack app in Go recently? 💭

@ndrean
Copy link
Contributor

ndrean commented Jan 4, 2025

But have you tried building a full-stack app in Go recently? 💭

No! In fact, never.

Saying that, I am not advocating for Go, nor saying that Elixir is bad.

We once had plenty of CSV files to parse into JSON, really plenty. Doing this in NodeJS was a magnitude faster than with Elixir, so they did not choose Elixir. Just one example.

You’d be surprised how many people are oblivious to “speed and efficiency”.”

I probably dealt with "poor" customers 🤷‍♂️ ? but in general, they were very interested with these costs. But I admit I don't have statistics so my input has little value.

@nelsonic
Copy link
Member Author

nelsonic commented Jan 4, 2025

"poor" customers ... 🤣
frugality is a very good thing. 👌

Go Apps are typically deployed using K8s, which as you know is Super Expepensive. 💸
So companies end up spending way more cash deploying the equivalent Go App 💰 🔥
than they would deploying the required Elixir instances to match throughput.
And there end up being considerably more "moving parts" in the Go deployment.

The Go equivalent for LiveView is: https://github.com/jfyne/live GitHub Repo stars
Nowhere near as mature as LiveView despite there bing many more Go devs than Elixir ones.
I just don't think Go devs want to build realtime apps ... 🤷‍♂️

Anyway, back to the topic of this thread; Native JSON in Erlang / Elixir. 🎉
It probably doesn't offer that much of a perf boost over the Elixir implementations. 💭
But one fewer dependency is always good as it lowers the build size and RAM requirements. 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Share your constructive thoughts on how to make progress with this issue elixir Pull requests that update Elixir code enhancement New feature or enhancement of existing functionality technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

2 participants