AstonJ

AstonJ

Do you use Dialyzer/Dialyxir in your Elixir projects?

Do you use Dialyzer in your projects?
  • Yes - all of them
  • Yes - some of them
  • No
0 voters
  • If you only use it in some of them, which ones?
  • If you don’t use it, why not?
  • If you do, any thoughts or experiences you’d like to share?

Showing Posts 1 to 10

eksperimental

eksperimental

Totally! And additionally I use Gradient, and Credo, and ExDoc in every project as part of my QA.

BartOtten

BartOtten

Recently added specs to a lib I am creating and let Emacs run the dialyzer.

However, I might checkout other typing libs in the future as imho dialyzer clutters the codebase and it’s error reporting is not on par with modern type checkers.

LostKobrakai

LostKobrakai

I find dialyzer to work well for projects, which are deployed. I tend to not like it for libraries, which don’t really use their code, because that usually means dialyzer doesn’t find half of the issues.

mpope

mpope

Hopefully Gradualizer as well, once it is mature enough to run on large code bases!

trisolaran

trisolaran

I use dialyzer, but it’s almost an act of faith for me: I pray and hope it will help me discover some nasty bug in my code someday. That hasn’t happened yet but I keep waiting and hoping :slight_smile:

tj0

tj0

Yah, I used it for a year, but I finally gave up updating specs. Doctests seem to do the trick for me.

brightball

brightball

Yep. Big fan.

Anything that lets me catch potential issues before they happen brings me value.

xpg

xpg

I always try to have typespecs on my functions, both as an help to the reader of the code, but also in order to allow the Dialyzer to catch at least some errors.
But I have to admit that I do have quite a love/hate relationship with the Dialyzer. It does really catch potential errors, but the error messages can be really difficult to understand, especially when largish structs are involved.
Over time I’ve gotten somewhat used to the error messages so much, that I in most cases relatively quickly can scan through the errors and identify the problem. But for newcomers, it’s really not a pleasant experience.
However, as I do prefer having explicit typespecs on most functions, it is really nice to have at least some validation of them.

sbuttgereit

sbuttgereit

I’m using it but I definitely have mixed feelings about doing so. I’m currently building my first non-trivial/non-toy project with Elixir and I would say on balance Dialyzer has been helpful, but it can be frustrating. The cost/benefit of employing Dialyzer isn’t completely clear to me yet.

On the plus side I do think it has helped me to find issues, maybe not a lot show-stoppers, but let’s say it’s kept me honest. I also like the documentary aspect that the typespecs have on code, despite the visual clutter.

The downsides, often times the problems it finds are with code that works fine and would even always work fine even in the presence of the found error; the more important errors are usually found through other means like reasonable testing before I get there with Dialyzer. I’m concerned that I don’t understand what sorts of things it won’t or can’t find that could be real problems; it’s possible to take typespecs pretty far, but that Dialyzer the tool can follow is unclear. Finally, I get a number of errors in my editor (VS Code / ElixirLS) that don’t get found by Dialyzer. I think this is due to false negatives in the editor moreso than Dialyzer missing something; the cases that I’ve very thoroughly looked into this has been true and the fact that often times I can resolve the issue the editor is reporting by cleaning/rebuilding the project suggests that the Dialyzer analysis is more correct. My gut feeling is that the presence of typespecs seems to cause these discrepancies between the tools to happen more often than not having the typespecs. Anyway all this leads to the feeling that I’m investing a fair amount of time troubleshooting the tooling and that writing of typespecs causes a class of false negatives leading to distractions from the work at hand.

As a beginner in writing the language without a second set of eyes looking over my results, I think this ends up being a net positive since even the smaller issues that I tend to find with Dialyzer are conditions I need to be sensitive to to move beyond the beginner stage. But if I were more accomplished or working on a team, as I said at the beginning, it’s unclear whether or not the benefits would out-weight the maintenance overhead. I want to feel that running Dialyzer in CI and getting an all clear means that I’ve achieved a certain kind of soundness to a high degree, but that trust just isn’t there yet.

stefanchrobot

stefanchrobot

No. Too slow, too cryptic. Hoping for something like Gradualizer to be usable. In the meantime, I invest time in end to end tests.

Where Next? Top

Trending in Polls Top

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews