3 ms·
Erlang doesn't lack types. It's also strongly typed. You can get quite far with properly chosen guard expressions (`is_binary`, `is_number`), general pattern ma
by filmor 6y ago
Erlang doesn't lack types. It's also strongly typed. You can get quite far with properly chosen guard expressions (`is_binary`, `is_number`), general pattern matching and Dialyzer to check what's checkable.
Static typing severely hinders hot code-reload, which was deemed more important for long running systems.
- loxs 6y agoThese are runtime checks and have nothing to do with what most people understand under the term "static typing/types".
- igouy 6y agoDialyzer is a static analysis tool. https://erlang.org/doc/man/dialyzer.html https://erlang.org/doc/man/dialyzer.html
- loxs 6y agoIt is, but is_number is not, which I am replying to. Probably should have mentioned, my bad...
- filmor 6y agoJust to be clear, I intentionally never said anything about static types. The type system is "strong" in the sense that variables never change their type or are "interpreted" based on context, they don't even change their value after assignment. And whether your types are runtime-checked or statically checked doesn't really matter with regard to the invariants that hold for your code. In the former case, you'll have to be able to handle type errors at runtime as well, which is reasonably easy in Erlang due to the strong isolation it provides.