moxley

moxley

Phoenix project doesn't use Dialyzer?

I noticed the Phoenix project doesn’t appear to have configuration for dialyzer. Running dialyzer against it produces many errors (I used some basic configuration from another project). Does Phoenix not use Dialyzer? And if not, is there a reason why?

Most Liked

ericmj

ericmj

Elixir Core Team

If it’s in CI it means contributors need to know about it or I have to fix the issues they introduce. I don’t think it’s worth it for myself either since there have, at least traditionally, been many errors that are not fixable in generated code and with protocols. Errors that we cant fix also makes CI practically useless since it will always fail. The effort is usually not worth the value it provides.

Dialyzer does not do what I want a type checker to do. In traditional type systems you write types and then verify the code against the types - the types are the contract. In dialyzer the code is the contract, dialyzer ignores the types and uses the code as single source of truth. After verifying the code without the help of user-given types it then checks the types against the code, but this is limited since it will only show an error if it can guarantee that the type does not match the types inferred from the code.

This is the correct behaviour of dialyzer because it should never reject valid code [1], but for me it makes it a lot less useful.

[1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.3859&rep=rep1&type=pdf

ericmj

ericmj

Elixir Core Team

I can’t say why Phoenix isn’t using Dialyzer, but personally I feel like the value it provides does not outweigh the downsides it brings. Dialyzer makes it harder for contributors because it’s slow, the errors are hard to understand and you need knowledege of Erlang syntax to understand it.

I would rather get more contributors and have Phoenix more approachable to beginners than use Dialyzer.

Crowdhailer

Crowdhailer

Creator of Raxx

Interesting, as I was thinking of adding dialyzer to my project, with the hope of onbording contribute with more guide rails.

Where Next?

Popular in Discussions Top

Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
sashaafm
Piggy backing a bit on @dvcrn topic BEAM optimization for functions with static return type?, I’ve been trying to understand in a deeper ...
New
ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19204 150
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Other popular topics Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement