by akudha · 1y ago · 0 comments
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?
This idea that static typing is such a massive issue for OTP style servers and messaging is a very persistent myth, to be honest; I've created thin layers on top of OTP for both `purerl` (PureScript compiled to Erlang) and Gleam that end up with both type-safe interfaces (we can only send the right messages to the processes) and are type-safe internally (we can only write the process in a type-safe way based on its state and message types).
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.