Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is always a preference issue. You get strong types but the nature of hot loading and communication across clusters doesn’t leading to static typing being a practical trade off. The moment you add it, you end up with a need for contract enforcement across nodes that changes most of what the platform is designed around.

In practice, static typing just doesn’t add much other than headaches to a project of this style. Doesn’t mean you’re wrong for wanting them, just that the language might not be for you if you feel like you need them that much.



I understand why dynamic typing might be needed for code reloading and multiple nodes. However for an overwhelming number of uses a single erlang node is sufficient and code reloading itself comes with additional complexity that it is only useful for rare applications. On the other hand hand static types give you cheap and easy freedom from a large class of bugs. Erlang spends a lot of time bringing reliability through sophisticated patterns such a supervision trees etc etc but then totally fails by having dynamic typing. I love Elixir/Erlang but I would say that here (provocatively perhaps) the platform is penny wise and pound foolish: It spends a lot of time on sophisticated strategies while omitting the most elementary one: static types. I like the platform but like every platform it does have weaknesses. To me, personally, missing static types is a weakness.


You may want to take a look at https://gleam.run/


Gleam might be what you need then. The combination of strong types, dialyzer, guard clauses and pattern matching has been more than enough in my experience.

Fully static typing doesn’t bring its benefits without costs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: