Hacker News new | ask | show | jobs
by amorphid 2891 days ago
I quite like mix and hex. Now all we need is sane, Elixir-y dialyzer errors!
2 comments

Disclaimer: I'm a maintainer but the next Dialyxir release makes a major improvement on this, thanks to contributions from Andrew Summers. He wrote a parser for the Erlangified term strings and uses the Elixir (1.6) pretty printer to print all the terms the way Elixir would. We're still fine-tuning the error messages and explanations but there is an RC on hex[0] - give it a spin if you haven't yet.

[0] https://hex.pm/packages/dialyxir/1.0.0-rc.3

Hi Jeremy! If anyone has any questions about this work, I'm willing to answer them!
Wow nice. The rate of progress is amazing.
I'll check it out tonight!
thanks, the current state of dialyxir is quite good! I use it in my toolchain.
Awesome. Thanks
You should try Dialyxir 1.0.0-rc3! The error reporting is vastly improved by a GSoC student.

Now you can get errors like this:

  ________________________________________________________________________________
  apps/activity_feed/lib/activity_feed/push_notification_listener.ex:10:callback_type_mismatch
  Callback mismatch for @callback push/2 in ActivityFeed.ListenerBehaviour behaviour.
  
  Expected type:
  {:error, _} | {:ok, _}
  
  Actual type:
  :ok
  ________________________________________________________________________________
  apps/activity_feed/lib/activity_feed/push_notification_listener.ex:24:pattern_match
  The pattern
  _ = {:error, _}
  
  can never match the type
  :error | :ok
Not quite -- that was me =). The GSOC student (Gabriel Gatu) is incorporating that work along with the incremental Dialyzer from the Elixir-ls project, and taking some of the new Dialyxir errors and morphing them a bit into a task that can be eventually merged back upstream into a more mainline mix task. You can track his progress here [0].

The lion's share of the work is now extracted into Erlex [1] which can be incorporated into other tools as needed.

[0] https://github.com/gabrielgatu/mix-dialyzer

[1] https://hex.pm/packages/erlex

Ooops! Sorry for getting that mixed up! erlex sounds like a neat project! I hope you make an Elixir Forum post about it so that more people are aware of it, I think it probably has quite a few good uses.
No trouble! I had unfortunate (or perhaps fortunate for Gabriel!) timing with its completion. Making a forum post is a good call! I need to throw some more docs in there, but I'll make one after that's in decent shape.