4 ms·
I like the BEAM and philosophy of Elixir, but there's just...no static typing. As someone coming from TypeScript and Rust, this makes it a very hard sell when I
by cercatrova 4y ago
I like the BEAM and philosophy of Elixir, but there's just...no static typing. As someone coming from TypeScript and Rust, this makes it a very hard sell when I can write web servers with either language just fine and have the compiler catch the many errors I've made. I suppose there is Gleam but the more esoteric the language (or technology in general), the harder it is to debug, so I don't want to be stuck with that kind of situation for a production environment.
- hdra 4y agoagreed. while not a deal breaker for me, i just wish the type hinting system is a more integrated part of the language rather than the awkward annotation-like system that it is right now
- gregors 4y agoIt's the chocolate ice cream vs vanilla ice cream argument. There isn't an accounting for taste. If static typing if your thing it's never going to taste the right way to you. I'm just the opposite, I greatly appreciate dynamic languages and if Elixir had been static I wouldn't be using it. That's probably from my Ruby experiences. My own stylistic tastes change from year to year but that's where my current taste is set. I keep seeing dynamic languages add type hints or bolt on static checkers. I personally just don't get it. I'd much rather just use Rust, Crystal, Golang, Java or Haskell if that's what I wanted.
- cercatrova 4y ago> I keep seeing dynamic languages add type hints or bolt on static checkers. I personally just don't get it. I believe it's because at scale, like Ruby at Stripe or Shopify or GitHub, it gets very difficult to change things without other stuff breaking, which a static type system ameliorates. Personally that's why I like static typing over dynamic, as I've initially started with dynamic languages like Python and JS and moved over to static variants because of all the frustrating mistakes I made which a compiler could have caught.
- 9gagceo 4y agoFWIW there is an ongoing PhD scholarship for researching and developing a type system powered by set-theoretic types for Elixir. [0] [0]: https://twitter.com/josevalim/status/1535008937640181760 https://twitter.com/josevalim/status/1535008937640181760
- ravi-delia 4y agoFor me at least, I realized that a lot of what I liked about static typing was, one way or another, pattern matching. When you match on type, all of a sudden it's explicit in the code what you're working with. It doesn't capture anywhere near 100% of the value of static typing, but in effect you do wind up with functions which dispatch once and component functions in the interior that don't need to worry about getting passed something nutty. So the library boundary will take lots of logically equivalent inputs, but the output will pretty much always be regular.
- fellellor 4y agoPattern matching is helpful but requires you to duplicate parts of the type’s specification quite often if not always.