3 ms·
I write Elixir for work and I love most things about the language. The pattern-matching would still be made better with static checks. It sucks to have a funct
by franz_kafkaagh 4y ago
I write Elixir for work and I love most things about the language.
The pattern-matching would still be made better with static checks. It sucks to have a function blow up at runtime because of something as trivial as args being swapped or some code somewhere changing its return types. Someone brought up Gleam earlier, but god why with that syntax?
I'd still rather have dynamic checked pattern matching over the alternative.
- 0x69420 4y agodialyzer and a liberal sprinkling of typespecs gets a decent chunk of the way there, meanwhile the problem with gleam and friends is the fact that they're altogether new languages -- the pragmatic solution would be a restricted subset of erlang (that a likewise restricted subset of elixir could comfortably compile down to) where your module has to be fully typed, but you would need some pretty gnarly logics to handle things like "yes, when this function mashes these two iolists together in this way, it's still an iolist" etc
- franz_kafkaagh 4y agoI'm hoping that https://github.com/josefs/Gradualizer https://github.com/josefs/Gradualizer and its Elixir counterpart get us closer to what "I" want. I find dialyzer often inscrutable compared to something like OCaml's or Haskell's type errors. I do still use it and typespecs, because it's better than no checking.