There is often some "redefinition of terms" going on with dedicated functional programming folks in order to assert their claims as you just demonstrated. There was some benchmark where mutable Java was shown to be around 30x faster than immutable OCaml and the discussion went to something like "no, no, that's a wrong comparison, compare it with immutable vs mutable OCaml, that is then just 2x slower! And the next compiler revision will remove it! 100% sure about it!" etc.
Why can't other modes of thinking coexist with your view? FP is OK, so is OOP, so is imperative, low-level machine code, "loop programs" (see Dennis Ritchie dissertation), logic programming etc. I like them all but hate it when somebody tries to push me one way telling me all other ways are wrong.
> Why can't other modes of thinking coexist with your view? FP is OK, so is OOP, so is imperative, low-level machine code, "loop programs" (see Dennis Ritchie dissertation), logic programming etc. I like them all but hate it when somebody tries to push me one way telling me all other ways are wrong.
Why do you think GP is saying or doing that? I think you've put a lot of words into their mouth that aren't there, and then got yourself worked up about it, enough to accuse them of ignorance and small-mindedness (at best).
I see absolutely nothing in their comment that even weighs in favor of FP, let alone saying other modes of thinking can't coexist. For all we know GP is a rabid OOP fan but sees the value in immutability (which FP certainly does not have a monopoly on).
OK, my apologies, that comes as a baggage from previous discussions with FP experts that routinely dismissed any opposing ideas and the OP's answer struck the same chord.
Sorry I don't mean to sound like an evangelist, I just meant that there are misconceptions out there about immutable data structures (functional programming aside: the two are not so intimately involved that they're equivalent).
I hope you can understand why benchmarking OCaml against Java isn't necessarily fair, since they have two completely different implementations (the latter being possibly the most mature set of JIT compilers and runtimes ever built). A more interesting comparison are immutable DAs in languages like C++, for example the immer library which has some very impressive performance characteristics for the problems it solves. And other applications like immutable ropes used in text editors which have extremely high performance compared to mutable variations. At the same time it's not a silver bullet, plenty of other immutable DAs have issues that are non-negligible and applications domains where in-place mutable DSs are required like hard-realtime.
Software engineering is about tradeoffs and not dogma, and that's what I was getting at. A take like "immutable is slow" is the counter dogma to "immutable is perfect."