|
|
|
|
|
by Vaguely2178
1128 days ago
|
|
Typespecs in Elixir (combined with Dialyzer) give you a very limited version of what TypeScript offers. From what I understand Dialyzer is designed to only raise an error when it's absolutely certain that you're mistaken about the types in your program. While this does prevent Dialyzer from complaining about false positives, it only catches the most trivial of bugs [1]. Also even with Elixir's typespecs, static typing is only fully useful if the entire ecosystem around a language embraces it. If some of the libraries you use don't ship with type definitions, it's going to be difficult for any static analysis tool to do a decent job. Almost every major JS library either ships with its own types, or has quality third party types available via Definitely Typed. It doesn't seem like the Elixir community has really embraced static typing to the same extent that TypeScript developers have. The creator of Phoenix for example hates dialyzer [2]. [1] https://elixir-lang.org/blog/2022/10/05/my-future-with-elixi.... [2] https://elixirforum.com/t/do-you-use-dialyzer-in-your-projec... |
|
Is this coming from experience? Because it surely doesn’t match mine