Gleam exists because Erlang syntax looks like it was designed to torture developers. Louis Pilfold, Gleam's creator, got tired of writing {ok, Value} = some_function()
for every damn function call. Gleam 1.0 dropped in March 2024 - I've been using it since version 0.8 and it's finally stable enough that I won't get fired for suggesting it.
What Gleam Actually Fixes
Three weeks ago my Node.js API crashed in production because someone passed null
to a function expecting a string. No type checking, no warning, just a silent failure that took down order processing for 2 hours. Gleam won't let you deploy code with that kind of stupidity.
When Gleam's compiler yells at you, it actually tells you what's wrong. Last week I had a type mismatch error - instead of getting cryptic bullshit like "error TS2322" it showed me exactly what types were expected vs what I provided. Fixed in 30 seconds instead of searching through 47 Stack Overflow answers.
The BEAM Runtime Advantage
BEAM was built for telecom companies that needed 99.9% uptime or people died. WhatsApp scaled to 900M users with 50 engineers because BEAM doesn't fall over when you get traffic spikes. Meanwhile I've seen Java APIs crash from 100 concurrent connections because someone fucked up the thread pool configuration.
Here's why BEAM doesn't suck:
- Actor model processes that use 2KB of memory each (not Java threads that start at 8MB and grow)
- Supervisor trees restart crashed processes without killing your whole app (learned this during a production incident where only one feature broke instead of everything)
- Hot code deployment that I've actually used in production without downtime (still feels like black magic)
- Built-in clustering - servers just know about each other without Consul or etcd bullshit
My last Node.js project started dropping connections at 1,000 concurrent users. Same logic in Elixir handled 50,000 users on the same hardware. BEAM is legitimately different.
Why Types Don't Suck Here
Rust's borrow checker makes me want to throw my laptop out the window. Haskell's type system needs a PhD to understand. Gleam just prevents the dumb bugs without making me hate my life.
When you screw up, Gleam shows you exactly where and how to fix it. No Googling "how to fix lifetime annotation in async function" for 3 hours.
Compile to Whatever You Want
Your Gleam code compiles to either:
- Erlang: All the BEAM runtime benefits, OTP supervision trees, the works
- JavaScript: Runs anywhere JS runs - browsers, Node, Deno, edge functions
I've used the same validation logic in both my API (compiled to Erlang) and frontend (compiled to JS). No rewriting, no "frontend validation is different from backend validation" bullshit.
Library Ecosystem Reality
Gleam's package ecosystem is tiny. But here's the thing - it can use any Erlang or Elixir library through FFI. Phoenix web framework? Works. Postgrex database driver? Works. That Redis library your entire architecture depends on? Probably works.
I've wrapped Erlang crypto functions, used Elixir HTTP clients, and called into weird telecom libraries from the 1990s. If it runs on BEAM, Gleam can use it. Check the awesome-gleam list but don't expect to find everything you need yet.
The real question isn't whether Gleam is worth learning - it's whether you're tired of debugging the same stupid runtime errors over and over. If you're ready to let the compiler catch your bugs before they hit production, let's get this thing installed.