logoalt Hacker News

satvikpendemyesterday at 8:13 PM4 repliesview on HN

How does it compare to Gleam? Or rather, why use Elixir over Gleam now? I suppose Phoenix and Live View in particular are big draws to Elixir.


Replies

asibyesterday at 8:16 PM

Do you like Rust or do you like Erlang? Writing Gleam is like writing Rust, writing Elixir is like writing Erlang.

I don't know the current state of Gleam OTP, but last I checked it wasn't great.

If you don't care about either of those things and only about types, use Gleam. But then why not just use Rust?

show 3 replies
josefrichteryesterday at 8:29 PM

Check Gleam website, they have the comparison right there.

show 1 reply
lawnyesterday at 8:30 PM

Gleam doesn't have macros, which many Elixir libraries (such as Phoenix and Ecto) uses to great effect.

Gleam for example has issues with verbosity of decoding/encoding json whereas in Rust you derive serde and in Elixir it's just a function call away.

Elixir has a more mature ecosystem. While you can for example use Phoenix with Gleam (or some other Gleam framework) the experience just isn't the same.

The big draw with Gleam over Elixir is the typing (where Elixir is now closing the gap) and being able to compile to JavaScript (which is also what Hologram is doing for Elixir).

I prefer Gleam's typing system and the Rust-like syntax, but for now I feel Elixir is the better choice for all my web dev projects.

show 1 reply
OtomotOyesterday at 9:23 PM

Phoenix and Ecto, really.