by rapind · 1y ago · 0 comments
Worth trying if you’re on the fence, especially if you’re into static types, no nulls, functional, ML type languages. Plus beam of course.
Some thoughts so far: Installing gleam installed about 50 packages on my system (possibly all erlang/elixir related). But what if I just wanted to transpile to js? Perhaps this is a packaging issue on my system though.
What I really wish is that Lua would be considered as another transpilation target. I think gleam could shine for DSLs in other programs but embedding Lua is 3x easier than embedding a js runtime imo.
In general, I find the nicest thing so far the community. And I want to say that the quality of libraries and resources in the gleam community seems exceptionally high. It reminds me of the rust community insofar as that for most hard problems someone smarter than me has already worked on it and published a good solution (e.g. lustre, squirrel). Then I would say you can also expect a lot of creativity and experimentation, the things that may fly under the radar in larger language ecosystems stand out here due to the growing and welcoming community.
Gleam is only officially distributed via the releases on GitHub [1] so if you pick up Gleam from a package manager that's always maintained by someone else. I think most of those community distributions do include Erlang and bits which is probably what pulled in all those extra packages!
[1]: https://github.com/gleam-lang/gleam/releases/tag/v1.13.0
https://www.phoenixframework.org/
https://www.amazon.com/Programming-Phoenix-Productive-Reliab...
If you don't run away from a framework intro, then dive into the details of the OTP:
https://www.amazon.com/Designing-Elixir-Systems-OTP-Self-hea...
https://www.amazon.com/Elixir-Action-Third-Sa%C5%A1a-Juric/d...
The only foot-gun I would initially avoid, is a fussy fault-tolerant multi-host cluster deployment. Check out RabbitMQ package maintainers, as those guys certainly offer a fantastic resource for students ( https://www.rabbitmq.com/docs/which-erlang .)
Best of luck =3
To be fair, I can't think of anything I care less about than static typing, so please keep that in mind when entertaining my opinion.
I thought I'd share my experience, not trying to convince anyone ; - )
My original plan was either Elixir or vanilla Erlang depending on which one suits my sensibilities better. Reading about Gleam recently has me super, super excited. That's definitely going to be my path now.
I don't know if Gleam is the best entry into the world of rich types that you find in a language like Haskell--I'm yet to actually build something with it.
What I can tell you is that Haskell is a complete joy to use and it honestly ruins most other programming for me. So as a direction, I cannot recommend it enough, and I'm hoping, for my sake and yours, that Gleam offers a similarly stimulating sandbox.
Just a warning that it will take time to get used to "higher-kinded" types. It's an exercise in head scratching and frustration at first. The reward part arrives when you start thinking in types yourself and you know which ones to reach for and when you find the libraries you want by entering a signature on Hoogle.
I have a F# background, and thought to have read that some constructs I learned to appreciate are not available in Gleam (the one I can think of right now is currying, but I thought there were others).
Also, Gleam otp didn't seem to be a priority.
What's your experience regarding these 2 points?
Edit: I do miss static typing, but it's worth it to not have to reinvent the web framework wheels myself.
There's not much documentation/resources around OTP in Gleam. When I was playing around with it I often found myself referring to the Elixir docs and then 'translating' that knowledge to Gleam's OTP implementation.
Gleam is still very new so this is totally understandable, and both are great languages so you'll likely have a lot of fun learning either of them.
0 - https://pragprog.com/titles/jaerlang2/programming-erlang-2nd...
I read Programming Erlang later, but it was just for fun, and I knew most things already at that point.