News for hackers. Stuff that matters.
Re:Joy of Elixir (2020) by cercatrova on Saturday September 17, 2022 @09:30AM (#32877389)
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.
Re:Joy of Elixir (2020) by gregors on Saturday September 17, 2022 @11:05AM (#32878092)
It'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.

Re:Joy of Elixir (2020) by cercatrova on Saturday September 17, 2022 @12:30PM (#32878797)
> 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.

Re:Joy of Elixir (2020) by 9gagceo on Saturday September 17, 2022 @11:50AM (#32878476)
FWIW 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

Re:Joy of Elixir (2020) by ravi-delia on Saturday September 17, 2022 @03:02PM (#32880352)
For 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.
Re:Joy of Elixir (2020) by hdra on Saturday September 17, 2022 @10:40AM (#32877891)
agreed. 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
Re:Joy of Elixir (2020) by fellellor on Sunday September 18, 2022 @02:17AM (#32884919)
Pattern matching is helpful but requires you to duplicate parts of the type’s specification quite often if not always.