logoalt Hacker News

The Gleam Programming Language

125 pointsby Alupistoday at 2:49 AM63 commentsview on HN

Comments

pkos98today at 7:49 AM

Coming from Elixir, I gave Gleam a try for a couple of days over the holidays. Reasons I decided not to pursue:

- No ad-hoc polymorphism (apart from function overloading IIRC) means no standard way of defining how things work. There are not many conventions yet in place so you won’t know if your library supports eg JSON deserialization for its types

- Coupled with a lack of macros, this means you have to implement even most basic functionality like JSON (de)serialization yourself - even for stdlib and most popular libs’ structs

- When looking on how to access the file system, I learned the stdlib does not provide fs access as the API couldn’t be shared between the JS and Erlang targets. The most popular fs package for erlang target didn’t look of high quality at all. Something so basic and important.

- This made me realise that in contrast to elixir which not only runs on the BEAM („Erlang“) but also runs with seamless Erlang interop, Gleam doesn’t have access to most of the Erlang / Elixir ecosystem out of the box.

There are many things I liked, like the algebraic data types, the Result and Option types, pattern matching with destructuring. Which made me realize what I really want is Rust. My ways lead to Rust, I guess.

show 3 replies
erlend_shtoday at 9:11 AM

For a fairly advanced example project I can recommend looking at Quickslice, a dev toolkit for making AT protocol applications.

https://tangled.org/slices.network/quickslice

wiskiytoday at 8:04 AM

I am in love with Gleam! As a young computer science student, I found that Gleam brought back the joy of programming just when I felt like I was seriously burning out. I was never a fan of functional programming languages. I had tried other BEAM languages like Elixir and Erlang before, but Gleam is the one I’ve enjoyed the most :)

tomberttoday at 5:51 AM

I remember playing with Alpaca a few years ago, and it was fun though I didn’t find the resulting code to significantly less error-prone than when I wrote regular Erlang. It’s inelegant, but I find that Erlang’s quasi-runtime-typing with pattern matching gets you pretty far and it falls into Erlang’s “let it crash” philosophy nicely.

Honestly, and I realize that this might get me a bit of flack here and that’s obviously fine, but I find type systems start losing utility with distributed applications. Ultimately everything being sent over the wire is just bits. The wire doesn’t care about monads or integers or characters or strings or functors, just 1’s and 0’s, and ultimately I feel like imposing a type system can often get in the way more than it helps. There’s so much weirdness and uncertainty associated with stuff going over the wire, and pretty types often don’t really capture that.

I haven’t tried Gleam yet, and I will give it a go, and it’s entirely possible it will change my opinion on this, so I am willing to have my mind changed.

show 4 replies
pjmlptoday at 8:14 AM

Glean is interesting from language nerd point of view, however I never had a reason to use Erlang at work, and probably never will, and I suspect that relates to most folks.

show 1 reply
brandonpollack2today at 4:47 AM

I really like the idea of gleam but I don't want to hand implement serialization for every type (even with an LSP action) in 2026.

show 1 reply
lxdlamtoday at 6:12 AM

I still suspect the effectiveness of plugging in a type system patch to a complete system, like typescript to javascript. We still observe so many `as any` or `as unknown as` at every corner.

Despite of the suspicion, Gleam provides a better and elegant syntax for those who are not familiar with Erlang or functional programming languages, which I loved most.

show 2 replies
behnamohtoday at 7:49 AM

I'd rather them stick with ONE: JS or BEAM. Everytime a project claims it can do multiple things at once, it can't do either very well.

It's confusing too. Is Gleam suitable for distributed computing like Elixir/Erlang on BEAM? Would that answer change if I compile it to JS?

show 2 replies
azhenleytoday at 5:43 AM

A recent post about using Gleam for Advent of Code:

https://news.ycombinator.com/item?id=46255991

librastevetoday at 8:33 AM

thought I’d try the showcase example in Raku (https://raku.org), so this Gleam

  import gleam/io

  pub fn main() {
    io.println("hello, friend!")
  }
becomes this Raku

  say “hello, friend!”
well maybe you really want to have a main() so you can pass in name from the command line

  #!/usr/bin/env raku

  sub MAIN($name) {
    say "hello, $name!”
  }
show 1 reply
liampullestoday at 9:21 AM

I'm now working on a real world legacy Elixir project in my day job and man oh man do I miss well defined types. Coming from Go, it makes a huge difference to my productivity when I'm able to click through fields and find usages of things, which comes down to the excellence of the Go language server. I know that the Elixir language server can infer some of this, but the language server in my experience is very fickle and flat out doesn't work if you have an older Elixir project.

I'm paying keen attention to Gleam to see if it can provide a robust development experience in this way, in the longer term.

show 1 reply
kristopoloustoday at 8:27 AM

I've always thought this would be an excellent language for coding agents.

show 1 reply
stanlogintoday at 7:18 AM

I think they have an issue on homepage: there is no "download/get start" link. All big buttons link to a tour page, and stopped there.

show 1 reply
kunleytoday at 9:19 AM

One of programming languages with political agenda.

show 1 reply
phplovesongtoday at 8:40 AM

Gleam is nice. However it is still very lacking in the stdlib. You will need lots of dependencies to build something usable. I kind of wish Gleam could target something like Go, then you would have the option to go native without a "heavy" VM like the BEAM.

show 1 reply
Kindercrushertoday at 7:57 AM

[dead]

rapnietoday at 4:38 AM

Now here's a type-safe functional programming language I recently bumped into, which with their focus on simplicity, ease of use, and developer experience, and compiling to either Erlang or Javascript, is really tempting to delve in deeper.