First impressions of Gleam: lots of joys and some rough edges

2 years ago by ericjmorey to c/gleam

The blog post is the author's impressions of Gleam after it released version 1.4.0. Gleam is an upcoming language that is getting a lot of highly-ranked articles.

It runs on the Erlang virtual machine (BEAM), making it great for distributed programs and a competitor to Elixir and Erlang (the language). It also compiles to JavaScript, making it a competitor to TypeScript.

But unlike Elixir, Erlang, and TypeScript, it's strongly typed (not just gradually typed). It has "functional" concepts like algebraic data types, immutable values, and first-class functions. The syntax is modeled after Rust and its tutorial is modeled after Go's. Lastly, it has a very large community.

lung 1 point 2 years ago

Doesnt seem particularly better than Go, unless you count compiling to JS as a strong need (knowing the JS world, I have my doubts on how useful/convenient that is until webasm really is adopted)

path: 0 11698727, hotness: undefined, score: 1, children: 1
monogram 0 points a year ago
path: 0 11698727 18720081, hotness: undefined, score: 0, children: 0
Ephera 1 point 2 years ago

Huh, the parenthesization thing is interesting. Programming languages so often pretend to be maths, because in specific situations, people do a lot of maths with them, and you get a familiarity bonus for it.

But yeah, it's often clunky. I know in Rust, it's a real problem that they can't distinguish whether you're using < to compare the size of two numbers or to specify generics, which is why the turbofish-syntax exists.
And yeah, it just rarely feels actually worth it, as you could just as well write 3.less_than(5).

This parenthesization thing is definitely another such case, which I hadn't considered yet.
I imagine, for most languages, it isn't too big of a deal to have a special casing for that, as it mostly only overlaps with tuple-syntax, but for languages with implicit returns out of { }, it's kind of an unnecessary oddity in the syntax.

path: 0 11702262, hotness: undefined, score: 1, children: 0
monogram 1 point a year ago
path: 0 18757646, hotness: undefined, score: 1, children: 0
gleam
gleam

@programming.dev

login for more options
146
34
10

A community for the gleam programming language! https://gleam.run/

go to feed...