| ▲ | WJW 12 hours ago | |||||||||||||||||||||||||||||||||||||
Gleam is really quite a nice language. I did AoC in it this year as well and came away with the following: (incomplete list for both positive and negative, these are mainly things that come to mind immediately) Positive: - It can be pretty performant if you do it right. For example, with some thought I got many days down to double digit microseconds. That said, you do need to be careful how you write it and many patterns that work well in other languages fall flat in Gleam. - The language server is incredibly good. It autoformats, autocompletes even with functions from not-yet-imported-but-known-to-the-compiler packages, shows hints with regarding to code style and can autofix many of these, autofills missing patterns in pattern matches, automatically imports new packages when you start using them and much much more. It has definitely redefined my view of what an LSP can do for a language. - The language is generally a joy to work with. The core team has put a lot of effort into devex and it shows. The pipe operator is nice as always, the type system is no haskell but is expressive enough, and in general it has a lot of well-thought out interactions that you only notice after using it for a while. Negative: - The autoformatter can be a bit overly aggressive in rewriting (for example) a single line function call with many arguments to a function call with each argument on a different line. I get that not using "too much" horizontal space is important, but using up all my vertical space instead is not always better. - The language (on purpose) focuses a lot on simplicity over terseness, but sometimes it gets a little bit much. Having to type `list.map` instead of `map` or `dict.Dict` instead `Dict` a hundred times does add up over the course of a few weeks, and does not really add a lot of extra readability. OTOH, I have also seen people who really really like this part of Gleam so YMMV. - Sometimes the libraries are a bit lacking. There are no matrix libraries as far as I could find. One memoisation library had a mid-AoC update to fix it after the v1.0 release had broken it but nobody noticed for months. The maintainer did push out a fix within a day of realizing it was broken though. The ones that exist and are maintained are great though. | ||||||||||||||||||||||||||||||||||||||
| ▲ | tymscar 11 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
I was also pretty surprised about the performance. It's not C, but it's so much faster than I'd guessed. I do agree the language server is great. And it works in basically any IDE, which is another huge bonus. With regards to having to type `list.map`, you actually don't need to! You can do this:
Some libraries just aren't there, and I do wonder how hard it would be to port C libraries over. Something I want to play with! | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | ngruhn 12 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
I can live with these negatives. What irritates me the most is the lack of if/else or guards or some kind of dedicated case-distinction on booleans. Pattern matching is great but for booleans it can be kinda verbose. E.g. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | vips7L 12 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
> Having to type `list.map` instead of `map` or `dict.Dict` instead `Dict` a hundred times does add up over the course of a few weeks, and does not really add a lot of extra readability. I did it in F# this year and this was my feeling as well. All of the List.map and Seq.filter would have just been better to be called off of the actual list or Seq. Not having the functions attached to the objects really hurts discoverability too. | ||||||||||||||||||||||||||||||||||||||
| ▲ | IshKebab 10 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
Re argument formatting, I'd guess it's because it uses the Prettier algorithm which works like that. However in my experience it's much better than the alternative - e.g. clang-format's default "binpack"ing of arguments (lay them out like prose). That just makes them hard to read and leads to horrible diffs and horrible merge conflicts. | ||||||||||||||||||||||||||||||||||||||