5 ms·
> strong static typing and binding things as early as possible is how robust systems are built and how errors are minimized. Huh? What about Erlang?
by swannodette 15y ago
> strong static typing and binding things as early as possible is how robust systems are built and how errors are minimized.
Huh? What about Erlang?
- prodigal_erik 15y agoErlang is very good at making systems that can sort of muddle along and keep running despite containing serious mistakes, but it's almost no help with preventing or fixing them. Every static type (even inferred) does the work of a number of unit tests, though of course not all.
- swannodette 15y agoI suppose you've never head of Dialyzer which gives much better coverage than most static type systems.
- prodigal_erik 15y agoNo I had not. If Erlang now has working type checking, that's a huge advance. But I have to wonder why the Wikipedia page still claims Erlang is dynamically typed and doesn't mention this, and the getting-started guide barely names Dialyzer and doesn't demonstrate it at all (instead it's somewhere in the middle of the FAQ). How much consensus is there that it's ready for prime time?
- chc 15y agoThe fact that you can analyze the types doesn't necessarily change the fact that the language is dynamically typed (accepting that the terms are kind of wavy to begin with, and I've heard people mistakenly apply the D-word to very strongly statically typed languages with type inference).
- silentbicycle 15y agoIt's still dynamically typed. The dialyzer ("discrepancy analyzer") can detect many kinds of type errors statically by doing dataflow analysis over the possible types yielded by successful execution, but it's an external tool. Like lint, not part of the core language. For a good overview, check "Gradual Typing of Erlang Programs: A Wrangler Experience " (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.160.140&rank=1 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.160....) and/or "Practical type inference based on success typings" (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.3859&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62....).