upvote
I just learned Erlang this year and I love the syntax. Ending expressions with periods took getting used to, but capital first letters distinguishing variables, non-rebindable variables, semicolons between function clauses, a lack of boilerplate (defmodule et al), a fraction of end keywords, commas separating expression, ... all make for a very fun to use and ergonomic language, IMO.

I haven't tried Gleam yet, though. I'm interested in the focus on simplicity but a little wary because I understand they sacrificed niceties to minimize the language footprint, e.g., pattern matching in function heads. I intend to give it a shot the next time I'm greenfielding something.

reply
Erlang is my favorite functional language out of all the ones I've tried. The matchers, guards, etc are all done very well. But I don't like functional. I used to think it was cool, gave it a real chance using Erlang for years, and eventually decided it's not a good fit for many use cases. Like at some point the neatness of doing all loops as recursion wears off and it's just tiring. It's not like CS algo homework, and even there you often want DP/memoization.

Edit: pure* functional

reply
> Like at some point the neatness of doing all loops as recursion wears off and it's just tiring.

Odd, but I believe you, lol. Elixir's list comprehensions take a `:reduce` option which makes accumulating values a bit more "familiar" and I often use over `reduce`:

    for a <- list, reduce: []
      acc ->
        [a | acc]
    end
Not sure if there is something like that in Erlang (or Gleam for that matter).
reply
If you already have a list in Erlang, you can use map and the foldl/foldr reducers. But there's no general for-loop. You're expected to use tail recursion.

Also tbh, I don't like reduce either. I agree with that article posted on HN a while back about devs not liking reduce. Just want to insert into my list or whatever, not have to check how exactly reduce works in this particular language.

reply
> you can use map and the foldl/foldr reducers

Ya, I was saying as an alternative to a more dynamic-looking loop. And of course, `for` is confusing in Elixir it is not a for loop, it's a list comprehension and `<-` is actually a match operator.

But yes, I don't hate reduce, but I do try and avoid it for a higher level version for what I'm doing. My only real problem with reduce is that I sometimes forget the parameter order, which is why I like using list comprehensions since the accumulator gets labelled.

reply
I'm the same. I thought I was an oddball because so many people seemed to prefer Elixir but I like Erlang and its syntax. I wish I had more chances to use it at work but so far it's just been for hobby projects or playing with.
reply
There are dozens of us! Erlang is a great language, elixir just feels kinda flimsy and over-macro’d to me somehow.
reply
What was your background before Erlang? I came from Ruby, so Elixir felt much more like home than Erlang.
reply
I was fortunate enough to use Erlang professionally for a couple of years. I agree: the syntax is quite comfortable.
reply
I'd say if you know and like Rust, then Gleam should be easy to pick up but otherwise I'd try Elixir. You can learn most of the language in a few days and be experimenting with BEAM and supervision concepts basically on day one. As a learning exercise I think its worth peoples' time because actors/processes are one of the concurrency models you don't see everywhere but solve interesting problems well.
reply
I don't think that's the case, Rust and Gleam have almost nothing in common beyond having static type systems, and those type systems are very different too.

https://gleam.run/frequently-asked-questions/#How-does-Gleam...

reply
You don't think that Gleam has more familiar syntax to a Rust dev than Elixir? Or that the type system might feel more familiar?
reply
I think a Rust programmer is more likely to prefer Gleam to Elixir, but I don't think there is much link between Gleam and Rust, and I especially do not thing that Gleam should only be considered over Elixir if you are already a Rust programmer.
reply
So I said:

> I'd say if you know and like Rust, then Gleam should be easy to pick up

And you think that:

> a Rust programmer is more likely to prefer Gleam to Elixir

Are we maybe splitting hairs here?

reply
You said: >I'd say if you know and like Rust, then Gleam should be easy to pick up but otherwise I'd try Elixir.

This is way too strong and narrow statement. Gleam is statically typed garbage collected language, closer to OCaml than Rust. Elixir if you like dynamically typed instead.

reply
Obligatory comment that elixir is now gradually typed: https://news.ycombinator.com/item?id=48388324
reply
Tbh gradual typing sounds like a nightmare. Probably impossible to implement correctly, whatever your definition of "correctly".
reply
Nah, the gradual angle is not what makes a type system tricky to implement. Plus we have published a few papers discussing how we are typing Elixir and how our approach is sound.
reply
It's very possible that I'm misunderstanding you! I'm mostly just saying that Gleam is very unlike Rust, so if you pick it or avoid it for Rust related reasons you may not be making the most informed decision.

The languages that Gleam is most like might be Standard ML, OCaml, Elm, and F#.

reply
You seem to be interpreting the statements as technical comparisons of the languages, but ch4s3 was (by my read) commenting on the overall ability of a programmer to jump from one language to another.

That is: they aren't similar languages on a technical level, but if you know Rust, you should be able to make the jump to Gleam pretty quickly.

reply
Aye, I am saying that jumping from Rust to Gleam isn't easy because the languages are so different. "How do I do X in Gleam like I would in Rust" is one of the most common categories of support question from newcomers who assumed they were similar.

It can take a moment to understand that things are done quite differently in the two languages due to being so different: https://gleam.run/frequently-asked-questions/#How-does-Gleam...

reply
> The languages that Gleam is most like might be Standard ML, OCaml, Elm, and F#.

And guess which languages inspired several things in Rust.

reply
The ML family clearly inspired Rust greatly, but the end result is very different.
reply
I use Rust and prefer Elixir over Gleam because Elixir has Lisp-style macros (Gleam doesn't), uses OTP directly, has the fantastic IEx REPL (Gleam has no counterpart), and has Phoenix, the best web framework I've ever used.
reply
Yes, exactly my point! Being a Rust user doesn’t mean you are going to prefer or even understand Gleam.
reply
> I'd say if you know and like Rust, then Gleam should be easy to pick up

I think by sentiments like this, people mean if you know unions, records, and pattern matching then you'll more easily pick up another language that has unions, records, and pattern matching.

reply
Yep, that's essentially what I mean. There's even this official cheatsheet[1] that shows a lot of overlap.

[1] https://gleam.run/cheatsheets/gleam-for-rust-users/

reply
This shows only the base syntax and has nothing of the language functionality, so is incapable of showing overlap between the languages.
reply