94 points · by crowdhailer · 2y ago · 29 comments
It's still early days in its evolution, and it remains to be seen if it manages to reach self-sustaining popularity like Elixir has. I hope it does. A statically typed, functional language on the BEAM with a healthy ecosystem is pretty much my dream platform.
It doesn’t have macros, which are one of Elixir’s most important features. Even if you rarely write macros yourself in application code, the most popular libraries in the ecosystem (Ecto, Phoenix, Absinthe, etc) make heavy use of them. The popular DSLs they provide wouldn’t otherwise be possible.
But I guess only time will tell.
I think it's a bit strange to bring up macros here. There are lots of languages that don't have Elixir's macro system, and they're doing fine.
I was just going by that.
Re: macros, I brought them up because their absence was a reason I wasn’t drawn to the language when I checked it out a few years ago. I really do think macros are a big deal and all the other newer languages I use, such as Rust, have them or some kind of meta-programming features.
The biggest missing feature for me though is the lack of a receive syntax. Sending and receiving messages should be a first class citizen on the BEAM. There is a very limited workaround in the standard library, but I guess the requirement for type safety means we'll have to wait forever for anything that can actually do things like listen to PIDs or the inbox without Erlang or if the box.
I'm still hopeful this will be tackled, as I really can't stand the concurrency primitives of most other statically typed languages and Gleam has the most promise to fill that niche.
And I have the exact same thoughts as you have.
By the way, the link to the CodeFlask library is broken (with extra ".js" at the end). The correct link is: https://kazzkiq.github.io/CodeFlask/
Here is the example : https://tour.gleam.run/functions/function-captures/
ReScript just recently removed auto currying (inherited from ocaml) and instead added a very similar syntax for partial application. It just uses ... instead of _ for the arguments.
It's very much an area of R&D, and we hope that folks share any ideas they may have. For example, I'm unfamiliar with Kotlin's system and it would be useful if folks could share any vision for how it could be applied to Gleam.
Kotlin recommend ksp [1] but underlying platform's reflection is also available. I am not sure it (or something similar) will be a great fit for gleam but have been planning to explore it deeper for some time.
I now feel that some form of behind-the-scene code-generation or reflection support is generally good to have so that the bulk of the application stays focussed on application logic instead of various dto conversions, mappings, transformations etc. I don't shy away from Quarkus, MapStruct etc. now a days and I think my code is easier to follow because of what they enable.
Typescript is a bit of an exception here because the type system is quite powerful with various type transformation capabilities but Gleam's type system also appears to be quite minimal.
KTor kind of relies on Kotlin serialization which uses code generation behind the scenes (which is why you need to apply a plugin on your build system).