A bit of an off topic, but I think FP is a flawed concept in practical terms - it focuses on disallowing local mutation, but usually does nothing to prevent global mutation (which usually happens when the program interacts with its environment via network/OS calls etc.). The resulting programs are just as crash prone as if they were written in Java.
Why did nobody go for the actually useful sweet spot - allowing procedural/local mutation, but making the procedures themselves 'pure' and taking care to control side effects on the program scale?
This would allow for things like actually useful time travel debugging and runtime code modification while keeping the performance and familiarity of procedural languages.
> allowing procedural/local mutation, but making the procedures themselves 'pure' and taking care to control side effects on the program scale?
This is what Haskell does by encouraging you to bundle the part of your code that does mutation into, for example, a state monad, and pass the result of the monadic computation to other pure functions.
Why did nobody go for the actually useful sweet spot - allowing procedural/local mutation, but making the procedures themselves 'pure' and taking care to control side effects on the program scale?
This would allow for things like actually useful time travel debugging and runtime code modification while keeping the performance and familiarity of procedural languages.