News for hackers. Stuff that matters.
Re:Why Erlang? by dimitrios1 on Wednesday September 01, 2021 @09:23AM (#28379494)
> I could never understand why is immutability not the default in all the popular languages

My take (could be wrong, happy to be corrected): Because most PL designers want speed to be pre-eminent in their language. One of the quickest way to never have your language adopted by large corporation is to have it be slower, without some obvious great benefit in productivity.

That's the catch though: Arguing for increase in productivity is harder, because it is qualitative, and ultimately subjective. Plus it's a crowded market these days in language productivity land, and unfortunately most of those languages are dynamically typed. Showing some benchmarks on paper is easy to do, and an easy way to sell a language.

So how does this all tie back in? Well, if you want to go fast, you need mutability (and up until most recent times: shared mutable memory, although this appears to be changing to non-shared mutation models). As memory and workloads get bigger and bigger, the cost of copying increases.

Re:Why Erlang? by kaba0 on Friday September 03, 2021 @08:18AM (#28403166)
Immutability is not inherently slower. It provides for much better reasoning that may even result in superior performance.

Of course retroactively introducing them to a largely mutable language may not prove to have better performance, but eg. Haskell is most definitely not slow.

Re:Why Erlang? by Kinrany on Wednesday September 01, 2021 @09:49AM (#28379769)
Immutability being the default does not prevent mutability.
Re:Why Erlang? by qwerty456127 on Wednesday September 01, 2021 @09:57AM (#28379871)
Obviously. It's just makes it an available option and the default. And this already is helpful.