HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jeremyjh
dialyxir
Elixir2015–2023
jeremyjh / dialyxir

dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.

14Distinct people
17Mentions
1Explicit recommenders
1.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Mix tasks to simplify use of Dialyzer in Elixir projects.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Agreed on the typing, however. Have you guys looked into Dialyzer? Dialyzer is a static analysis tool for Erlang and other languages that compile to BEAM bytecode for the…

qohen used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year17 dated mentions

Observed mentions: 2015-04-23 16:36:00 UTC to 2023-08-14 16:45:21 UTC.

012342015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC303
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC404
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202

What Hacker News says

17 sources
For those of you who are interested by Elixir but find the lack of static typing an issue here are somethings to be aware of: 1. Static Typing is planned and currently the top priority of the team https://elixir-lang.org/blog/2022/10/05/my-future-with-elixi... 2. There is a type checking tool https://github.com/jeremyjh/dialyxir 3. You can go a long way with pattern matching and guides in the meantime and have alot more guarantees that a typical dynamic typed language.
In Elixir – Why the dot when calling anonymous functions?
> Are many of the other languages you've used strongly typed? That's the thing that gives me pause - I feel like I rely on the compiler a lot in languages where it can do a lot for me, and that I'd be really frustrated managing a large project without it. As someone who has been writing Elixir professionally for 4-ish years, and who is otherwise about as big of a proponent of static types as is possible, this is simultaneously my biggest critique of Elixir, and also a critique that has ended up being more theoretical than not. I wish that it were statically typed, but in practice that hasn't been slowing me down. Part of the reason for that is that while Elixir is dynamically typed, I've found that it's possible to pretend it is a statically typed language if you squint just right. By that, I mean making judicious use of typespecs [0], di
Read the rest
alyzer [1], Norm [2], and just generally constraining the way you write code to mirror the sorts of code that you'd write in a language that offers algebraic data-types, like Haskell. I've been meaning to put together a blog post on what I mean by this, because I often hear people talking about how unusable Dialyzer is, so I feel like my team is a rare example of a large production app that requires that Dialyzer typechecks on every build. This makes large-scale refactoring of our app almost (but not quite) as easy as it would be in Haskell. The macro system in Elixir also means that it's possible to write libraries like typeclass [3], that offer compile-time guarantees (using compile-time property tests!) that your implementations correctly implement a given interface. I think that as the language evolves, we'll be seeing a lot more examples of macros that move runtime logic into the compilation step, to offer compile-time guarantees and safety. For example, a few weeks ago, I prototyped an experimental library in a few hours that added support for compile-time OCaml style parameterized-modules. [4] Obviously, all of these techniques don't get you quite as far as proper static typing would (though the Whatsapp team is working on static types for Erlang! [5]), but the rest of the language and the ecosystem is just so well thought out, that I've been okay with that! [0] https://hexdocs.pm/elixir/typespecs.html [1] https://github.com/jeremyjh/dialyxir [2] https://github.com/keathley/norm/ [3] https://github.com/witchcrafters/type_class [4] https://github.com/QuinnWilton/daat/ [5] https://www.facebook.com/careers/jobs/229713254864749/
In Build a real-time Twitter clone with LiveView and Phoenix 1.5
Not sufficient, and not for Erlang, but Dialyxir has a `mix dialyzer.explain` command, which gives an example of code that might cause a certain error. Some errors I have been unable to reproduce and I welcome examples of code that would produce them, so PRs are welcome =). Here is what I say for no_return, for example [0]. I maintain a library for converting Erlang Dialyzer messages to Elixir (Erlex [1]) which I hope to one day be able to retire with a stronger Elixir/Erlang communication (AST instead of string communication, e.g., and direct diffs between types). [0] https://github.com/jeremyjh/dialyxir/blob/master/lib/dialyxi... [1] https://github.com/asummers/erlex
In Clojerl – Clojure for the Erlang VM
I wrote a tool[0] that converts Erlang style Dialyzer messages to enough of Elixir to where the Elixir formatter can pretty print it. This isn't an intractable problem, but the source tool does really bizarre things so the output so it wound up being really annoying to deal with the quirks. Still not quite done, but it's in a workable state to where messages can be dealt with individually when the errors are poor. [0] https://github.com/asummers/erlex [1] https://github.com/jeremyjh/dialyxir
In Ask HN: What's the hardest problem you've ever solved?
> Elixir is overall a syntax that works well for me, at least as well as Rust’s. The Elixir team have made great strides in providing good compiler error messages, and are actively improving the distribution/ packaging story. Hex and mix are fantastic, and on par with what I’ve use in cargo. I'm working on making the dialyzer error messages better, too, in Dialyxir[0] and Erlex[1] =). [0] https://github.com/jeremyjh/dialyxir [1] https://github.com/asummers/erlex
In Erlang/OTP by Example
Not nearly as difficult, but I recently did a large project on converting Erlang Dialyzer output into Elixir friendly output in the Dialyxir[0] project, which involved a lot of lexing and parsing and pretty printing, though I was fortunately able to take advantage of the Elixir code formatter for a lot of the heavy lifting for output. My grammar rules, while better than they've been, are still pretty bad, but they seem to work well enough in practice for most programs that I've seen. The tl;dr for that project is that it runs dialyzer, finds the relevant Warning module for each warning, which will pretty print parts of the error output into a larger explanation, which involves taking the output, lexing it, parsing it, then pretty printing the IR back into Elixir, then running through the formatter. [0] https://github.com/jeremyjh/dialyxir
In The Hardest Program I've Ever Written (2015)
qohen·Jan 19, 2017Recommendation phrase
Agreed on the typing, however. Have you guys looked into Dialyzer? Dialyzer is a static analysis tool for Erlang and other languages that compile to BEAM bytecode for the Erlang VM. It can analyze the BEAM files and provide warnings about problems in your code including type mismatches and other issues that are commonly detected by static language compilers. The analysis can be improved by inclusion of type hints (called specs) but it can be useful even without those. For more information I highly recommend the Success Typings paper that describes the theory behind the tool. That's from the Dialyxir (for using Dialyzer w/Elixir) github page: https://github.com/jeremyjh/dialyxir More: http://learnyousomeerlang.com/dialyzer (Perhaps this should be read first: http://learnyousomeerlang.com/types-or-lack-thereof ) And this is the Success Type
Read the rest
s paper behind it (mentioned in the excerpt above): https://www.it.uu.se/research/group/hipe/papers/succ_types.p...
In Ask HN: Most productive functional languages?
Also I found Dialyzer (success typing checker) to be helpful in large projects: http://learnyousomeerlang.com/dialyzer The way success typing works it is a bit like static typing but when it cannot deduce the types it assumes success. However when it finds a discrepancy it is always right. So the more type annotations you add, and the more precise they are the more benefits you get from it. It has also been there for many years. I think Python only very recently has started getting the same kind of things via MyPy. Of course, they had to call it something differently (Optional Static Typing). Elixir has a wrapper around it, it seems: https://github.com/jeremyjh/dialyxir but never used it (I user Erlang mostly).
In Beyond 10,000 Lines: Lessons Learned from a Large Phoenix Project
Elixir and Erlang both actually have static typing in the style of Facebook's Flow - type annotations can be added to your functions[0] and there's a tool, Dialyzer[1], which can be run via Mix[2] to type-check your programs. It's not perfect - among other things, it can't type-check certain things that can and do happen in Erlang/Elixir programs, and won't complain about some errors - but it's better than being purely dynamic at not a whole lot more effort. [0] http://elixir-lang.org/getting-started/typespecs-and-behavio... [1] http://erlang.org/doc/apps/dialyzer/dialyzer_chapter.html [2] https://github.com/jeremyjh/dialyxir
In I Love Go; I Hate Go
> Details give the precision : no recursion allowed. Functional languages are out, there. > Func languages give no warranty on that either. Actually, what you can do in this case is when you call recursively, pass back an incremented counter variable as part of the state, and if it passes some upper limit, handle it appropriately. You don't need to "avoid recursion" just to get control over the number of times something loops. > and rely on garbage collection (which is forbidden, too) Fair enough, but if I work in a language that doesn't even give me much control (if any) over the GC, then how is this relevant to non-C coders, again? Which was my original point. > Name one professional code analyzer for any func language of your choice. Erlang (and by association Elixir) has Dialyzer http://www.erlang.org/doc/man/dialyzer.html which is a
Read the rest
static code analyzer. Static code analysis has been endorsed by John Carmack (and of course, all the 3 year old links to the blog post are now dead, sigh) For anyone (like me) who is hooked on Elixir, https://github.com/jeremyjh/dialyxir provides a bit of easier Dialyzer management Elixir (and I suppose Erlang) has this concept of "specs" which you don't have to use, but which help code analysis if you do... http://elixir-lang.org/docs/v1.0/elixir/Kernel.Typespec.html
In Rules for Writing Safety Critical Code

Showing the 15 most recent of 17 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.