Skip to content(if available)orjump to list(if available)

My First Impressions of Gleam

My First Impressions of Gleam

20 comments

·September 13, 2025

munchler

> I’ve also heard that functional languages lend themselves especially well to parsing tasks, and I’ve never understood why, so it’s a good opportunity to learn.

This is mainly due to a technique called "parser combinators", which can be expressed very cleanly in functional languages. The idea is to start with a standard set of primitive general-purpose parsers and combine them into more complex parsers that are specific to the task at hand. If you have an interest in either functional programming or parsing in general, parser combinators are good to have in your toolkit.

It looks like Gleam has at least two parser combinator packages that you might be able to use:

    • party (https://hexdocs.pm/party/)
    • parser_gleam (https://hexdocs.pm/parser_gleam/)

brightball

There was a great talk on Gleam at the Carolina Code Conference in 2024.

https://youtu.be/vyEWc0-kbkw?si=3o-KasK4H2n-0_KD

jszymborski

Gleam has long kinda seemed like my idea programming language. My only real hang-up is maybe an irrational one, but I don't love that it needs either a VM (BEAM) to run, or for it to be compiled to an interpreted language (javascript). I really wish it could target LLVM or something so it could be compiled down to native.

Maybe someone can sell me on BEAM though.

gmassman

The BEAM is an amazing piece of technology. It’s built to scale massive concurrent systems and has great developer ergonomics. I’ve used it with Elixir and it’s really a breath of fresh air as far as running a webserver goes. Much more flexible and simpler to manage than a python or nodejs runtime, and also capable of scaling up with far fewer resources than you would think. Highly recommend giving it a go!

brightball

The BEAM is very lightweight and necessary within Erlang to enforce one of its greatest tradeoffs:

- No universal garbage collector, every process (aka green thread) has its own heap that is reclaimed when it dies.

- No process can takeover the CPU. If you run a hugely intensive task in one process, everything else, millions of other processes potentially, will continue responding normally and consistently. The hugely intensive task will just take longer.

There’s more that applies to some advanced use cases, but these are the 2 core elements that are awesome.

asib

> [...] It’s an Elixir-like language that supports static typing.

Maybe just me, but when I tried Gleam it really came off much more like Rust. In fact, other than running on the BEAM (and having some OTP libs in the works), it doesn't really _feel_ like Elixir at all to me, but that is definitely an opinion.

sodapopcan

They probably just mean "BEAM language that isn't Erlang."

All BEAM languages always bring something new to the table aside from just syntax (for Gleam it's static type, for Elixir it's macros and, well, mix!) but none of them try and abstract away the core tenants of the BEAM being functional working with modules and processes. So ya, in that sense you could say it's like Elixir.

tengbretson

I've kind of gotten a

Scala : Gleam :: JavaScript : Lua

vibe from it.

jszymborski

It also most reminded me of Scala.

datboi_420

This was a great read! One thing that def makes Gleams error handling _look_ nicer, is utilizing `result.try` with the `use` keyword.

IncreasePosts

I'm glad I'm not the only one who hoarded all their AIM log data. Whenever I want to cringe I can pull up a random file

lordofgibbons

Gleam has caught my eye for the past year or so, and I'd totally learn it if I didn't believe firmly that we won't be coding by hand within the next 9 months. It'll all be done by LLMs so syntax and ergonomics won't mean too much. At least as soon as LLMs learn to stop being turbo-slop generators.

buggy6257

See you in 9 months then to check back.

a3w

Doe LLMs write valid Gleam programs? Trying with ChatGPT three years ago, it did not. Workarounds, like "here is the syntax as a system prompt", put into the prompt I would not consider understanding, as Gleam idioms and patterns will certainly not all fit.

0x3f

You should learn Gleam then.

echelon

> if I didn't believe firmly that we won't be coding by hand within the next 9 months.

LLM-assisted coding is awesome, but it feels like a self-driving style problem.

It's going to take 20 years to get there.

back2dafucha

The only languages Im interested in are future proof AI resistant languages. Since LLMs need alot of training (because they cant read language ASTs and write code correctly), a language that either isnt possible to express using fonts and character sets on the Internet, can only live in a private cloud, and is known to only verified practitioners runs on everything, and yet cant be decompiled.

You can launch a nuclear war in 5 lines of Visual Basic. I want a language AI doesnt know and cannot ever know.

jcmontx

You better start writing your own compilers then

DetroitThrow

>and cannot ever know

It might be resistant to human uptake in that case, too? Brett Victor I suppose has some interesting human-first or human-only physical computers.

back2dafucha

Thats ok. We have done enough language research to build another powerhouse language that is AI resistant that practitioners can use. Its uptake is only relevant to those that wish to exclude LLMs from the picture to resist the agents. When LLM agents are everywhere secret societies will become the norm.

We may even have the expertise to actually transpile every single program into a unique programming language so that if the source were available LLM bots would not recognize it in any volume enough to learn from it.