Wait, since when did functional programming imply immutability? I think fifty years of lisp would like to have a few words with this fellow.
Don't all scalable modern functional languages depend on immutability? So they can move function execution to different processes/virtual machines freely. Or something.
Pissed off about functional programming (2005)
21–30 of 65 posts
Re: Pissed off about functional programming (2005)
#22Wait, since when did functional programming imply immutability? I think fifty years of lisp would like to have a few words with this fellow.
Re: Pissed off about functional programming (2005)
#23Wait, since when did functional programming imply immutability? I think fifty years of lisp would like to have a few words with this fellow.
Re: Pissed off about functional programming (2005)
#24You can't re-bind values in the lambda calculus, so no, they never will change. This is why languages like haskell are immutable.
His complaint #3 also relies on the false assumption of a mutable language.
Complaint #4 was solved by monads, quite a while ago.
Re: Pissed off about functional programming (2005)
#25> It's theoretically possible that the 'f()' or 'x' might change between the lazy evaluation of step one and the lazy evaluation of step three million. Trying to prevent that is what we programmers call a 'hard' problem.
and the examples he gives in Myth 3 & Myth 4 where he reassigns `x` to mean something else. Both of these can be avoided had x been immutable.
I agree with the conclusion in Myth 2. I didn't understand the latter half of Myth 3, so can't comment on that.
Am I missing something wrt my assumption of immutable values solving most of the issues?
Re: Pissed off about functional programming (2005)
#26I don't quite get why the 'Substitutability' code snippet fails? Is it because the both vars 'point' to the same RAM address initialized with '3'? If that is the case, I would argue the language is somewhat broken, or at least it`s a major caveat ... Please explain?
Re: Pissed off about functional programming (2005)
#27Wait, since when did functional programming imply immutability? I think fifty years of lisp would like to have a few words with this fellow.
This implies immutability, because pieces of code, or functions that mutate variables / objects / data-structures are NOT referentially transparent.
> I think fifty years of lisp would like to have a few words with this fellow
LISP is not really a family of FP programming languages, even though LISP in general does apply concepts from lambda calculus and does have everything needed for FP. LISP in general is more like a multipurpose swiss army knife. For example the style people use to develop in Common Lisp is often very far away from FP. There are exceptions of course, like Clojure, which comes with immutable data-structures by default, strived to make uncontrolled mutation more painful and the culture around it does encourage FP.
Re: Pissed off about functional programming (2005)
#28I don't quite get why the 'Substitutability' code snippet fails? Is it because the both vars 'point' to the same RAM address initialized with '3'? If that is the case, I would argue the language is somewhat broken, or at least it`s a major caveat ... Please explain?
Isn't because after the increment operation, x has the value 4. Thus even if y has the value 3 and equals 3, it doesn't equal x.
Re: Pissed off about functional programming (2005)
#29As a beginner with knowledge of only F# and Clojure, I feel a lot of his issues are solved with having immutable values. > It's theoretically possible that the 'f()' or 'x' might change between the lazy evaluation of step one and the lazy evaluation of step three million. Trying to prevent that is what we programmers call a 'hard' problem. and the examples he gives in Myth 3 & Myth 4 where he reassigns `x` to mean so…
Re: Pissed off about functional programming (2005)
#30"Even a side-effecting function call in C has a well-defined "value" as a state transformer that maps states to pairs of states and values (the so-called "monad" in functional programmers' terminology). The reluctance of functional programmers to call such languages "referentially transparent" merely implies that they are reluctant to admit such complex mathematical/conceptual objects as "values". On the other hand,…
There's a difference between being able to imagine such a semantics and having that semantics be in common and widespread use or having it be useful to explain functions of the language or common techniques.
The nice thing about, e.g., Haskell is that these referentially transparent semantic models are really just shoved into your face. Purity makes it hard to ignore referential transparency. Monads make it incredibly clear when you have regions of code which aren't referentially transparent.
So, much like the whole contentious "vacuous type system" arguments from a day ago---these analyses exist naturally for practically any language you can think of but their value varies a lot depending on whether or not they are natural.