Try Gleam nchagnet.eu · 53 points · 63 comments · HN thread TL;DR Nicolas Chagne...
HN Best 200 @best
Try Gleam nchagnet.eu · 53 points · 63 comments · HN thread
TL;DR Nicolas Chagnet's blog post argues that Gleam, a statically typed functional language targeting the Erlang VM (BEAM) and JavaScript, is a pleasant and practical choice, especially for replacing some Kubernetes-based service setups with OTP actors. He covers pipes, the use pattern, tail-call optimization, and OTP supervision, and lists drawbacks such as a small ecosystem and the BEAM's low profile in industry.
- Gleam is a functional language on BEAM with a Rust-like feel, and it can also compile to JavaScript so types can be shared between a backend and a frontend.
- The |> pipe operator passes the piped value as the first argument, while the use pattern flattens callback nesting by placing the callback last.
- Gleam has no loops; iteration uses list functions and recursion, with tail-call optimization keeping deep recursion efficient.
- spawn_unlinked lets a crashing process leave its parent alive, and OTP supervisors restart failed actors, so the author suggests OTP could replace some Kubernetes pods for a scheduler.
- Listed drawbacks: a small ecosystem, no macros or automatic currying, and few well-known big companies visibly pushing the BEAM.
Discussion The thread mixes praise and criticism of Gleam. Early replies focus on the lack of currying and whether the _ placeholder covers partial application, with the author saying it does. Several commenters ask about full-stack tooling and framework support. A large side debate, sparked by a comment about the community's activism and code of conduct, gets heated and pulls in accusations and counter-accusations. A separate branch asks whether programming languages still matter when LLMs write most code, and replies mostly argue that humans still need to read and review code.
- Gleam is a pleasant, worthwhile language to try (many): Several commenters praise the language's design and the author's enthusiasm, and say they plan to try it. One commenter reports writing a web app in Gleam on both frontend and backend with mostly AI-generated code.
- Missing currying is a serious drawback (some): Commenters say currying matters for piping and partial application. Others reply that the _ placeholder covers the practical cases, though automatic currying is absent.
- Community activism or code of conduct puts people off (some): Some commenters say the community's public stances make them wary. Others say the code of conduct only governs behavior in community spaces, and call the criticism FUD or overblown.
- Code still needs human reading and review despite AI (some): Several commenters argue that reading code remains essential for verification, performance, and accountability, and reject the idea that languages should now be designed only for LLMs.
- Small ecosystem and tooling gaps limit use (a few): Commenters note missing libraries, such as a framework for web work, and a rough edge in the test runner, which makes running a single test hard. The LSP is praised as good for a small project.
Links from the comments
- Gleam tour section on function captures, which show the _ partial application syntax discussed in the currying debate
- The HN thread that one commenter cited as evidence of activism in the Gleam community
- Gleam's code of conduct, which another commenter argued only covers behavior within the community
#Gleam #BEAM #FunctionalProgramming #Erlang #TypeSafety #LLMs