News for hackers. Stuff that matters.
Re:Ask HN: Who regrets choosing Elixir? by mapcars on Saturday May 23, 2020 @12:50PM (#23284424)
Erm, you can setup dialyzer to be as strict as possible. This might not catch all the errors because of the nature of messages, but this is a pretty small part of a system usually and can be covered by tests.

>All in all it's not a useful substitute for a real type system used to model things.

>Type specs aren't useful for domain modelling

Can you give me some examples?

Re:Ask HN: Who regrets choosing Elixir? by 59nadir on Saturday May 23, 2020 @01:18PM (#23284672)
> Erm, you can setup dialyzer to be as strict as possible.

No. This is just plain false. Having used dialyzer since 2016 I can tell you it's not useful as a substitute for statically checked types via a compiler, with real strictness (which includes "When I don't have enough info, that's a type error").

> This might not catch all the errors because of the nature of messages, but this is a pretty small part of a system usually and can be covered by tests.

Not only will it not catch obvious type errors, it will also report false types when the core team doesn't use dialyzer in their libraries (because it doesn't work). These will bubble up to you instead and while you're mad they're not using dialyzer you'll still have to admit you understand why they don't.

I'm not sure what you mean by give you examples of how Elixir type specs aren't useful for domain modelling. They're ad-hoc, serve as documentation at best and even if they had structural power enough to express basic things they aren't checked at all, so you're getting none of the guarantees you would get in a statically checked language where your model changes and you can safely go forward by seeing what needs changing additionally to adapt.

Re:Ask HN: Who regrets choosing Elixir? by mapcars on Saturday May 23, 2020 @02:15PM (#23285067)
>They're ad-hoc, serve as documentation at best and even if they had structural power enough to express basic things they aren't checked at all

What they are is how you use them, can you show how you can model something with static types and how it is different from dialyzer?