It seems that people are very fired when it comes to discussions about static typing, namely these 2 topics received a lot of interaction:
- Type system updates: moving from research into development
- https://elixirforum.com/t/discussion-on-the-benefits-of-static-typing/56874 (this is actually offtopic from the first thread, but don’t tell anyone)
One of the prominent conclusion was that enforcement of something (in that instance types) in a language is a good thing.
Now we can all agree that immutability is thing that makes concurrency and distribution a 100 times easier, as there are strong guarantees that data passed around will not be mutated, however this is not a feature, but subtraction of feature from the language just as types are enforcement to specify types for everything.
If we agree that enforcement is a great thing, as it brings a lot of guarantees to the table, how comes the usage of functional languages is not the norm? For example haskell not only enforces types, immutability but also there are no side effects in the language, all effects are managed, another enforcement that is very powerful and can bring guarantees to the table.
From my personal understanding, here a few things that stop adoption of functional languages at large scale:
- Steep learning/relearning of new base concepts and a new style of programming, this is especially true for people used to OOP and mutable code style, I found that new people coming to development find functional approach much more easier and natural to understand;
- The misconception that immutable languages are not efficient because they cannot mutate state, this great talk shows that this doesn’t have to be the case: "Outperforming Imperative with Pure Functional Languages" by Richard Feldman - YouTube;
- People thinking in designing software in terms of Classes/Objects and not data flow/transformation, witch has to be the biggest stopper, as people cannot leave the OOP behind.
I am sure that there are people here who worked in a pure functional language in production and can tell their findings/conclusion on this, because as much as we love elixir, it partially a functional language that cannot be classified as a full-fledged functional language.
PS: When we talk about performance, I would like to point that the comparisons are made in regard to high-level languages, languages like c/zig/rust are out of the question as they are targeted at low-level things.