this post was submitted on 11 Aug 2024
11 points (100.0% liked)
Gleam
80 readers
8 users here now
A community for the gleam programming language! https://gleam.run/
founded 10 months ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.