mmport80

mmport80

Is Dialyzer worth the effort?

I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort.

It’s not as easy to use as type inference in statically typed functional languages, and you don’t get as much bang for the buck with its super optimistic success typing.

Perhaps some sort of saner alternative would be an option for Elixir 2.0?

I often think Clojure is the closest language to Elixir - Clojure spec and gradual typing sound v interesting.

Thoughts? Perhaps Dialyzer is better than I give credit, would like to hear some good counter-arguments ; )

Most Liked

Qqwy

Qqwy

TypeCheck Core Team

I fully agree with @PatNowak. The usage of @specs goes further than using Dialyzer. I find it very helpful that functions clearly indicate what input/output they receive, especially because Elixir is dynamically typed.

Dialyzer’s main purpuse, in my opinion, is to make sure that the written @specs match the function’s implementations. I completely agree that it is less nice to use than typing in a statically typed language, but even when not using Dialyzer, do not underestimate the @spec.

PatNowak

PatNowak

Dialyzer won’t work in many cases, but the most important for me if I see @spec above the function definition is that I’ more confident what should be input and output for that function. It’s easier to see one line of typespec than to analyze function’s behavior.

bobbypriambodo

bobbypriambodo

I pretty much share the sentiment. Having types guide your development is a benefit I get when developing with OCaml, Haskell, Java, etc.

I tried to get the typechecking more streamlined with my dev by integrating Dialyxir as a linter in Atom. I was surprised at first that it doesn’t exist already, but as I developed the package myself I can guess why anyone doesn’t bother; it’s kinda slow, even for a small project built on top of Phoenix, and the output is not easily parse-able. I finally just create a command using process-palette that will run mix dialyzer and I execute it every once in a while.

I however agree that the @specs helps a whole lot as documentation, especially when it shows on atom-elixir’s autocomplete. Types are great ^^

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
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
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
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
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43757 214
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement