3 ms·
"A good example is the notorious video interview https://www.youtube.com/watch?v=iSmkqocn0oQ https://www.youtube.com/watch?v=iSmkqocn0oQ in which Simon Peyton J
by ZenoArrow 12y ago
"A good example is the notorious video interview https://www.youtube.com/watch?v=iSmkqocn0oQ https://www.youtube.com/watch?v=iSmkqocn0oQ in which Simon Peyton Jones laments the fact that pure functional programming languages just make the CPU heat up and nothing else (i.e. they have no useful side effects.)"
You're not the first person I've seen that's misunderstood this video, I can only guess at why... One thing it's probably worth remembering is that Haskell has been a research platform for many years, and some of the Haskell features that people take for granted today did not exist in earlier versions.
SPJ is not saying that Haskell is useless now, but it was close to useless for creating programs for a number of years. As a case in point, try to imagine Haskell without monads. Hopefully knowing that Haskell did not have monads at one point helps you understand the historical context of this discussion.
- theoh 12y agoAre you saying the video predates the IO monad? I don't think that's true. In any case, I don't think I have misunderstood: I just don't agree with his notion that a hypothetical purely functional language is "useless", as I explained.
- kenko 12y agoI must have missed that explanation. What would the use of a really pure functional programming language be? One with no side-effects, not even printing to a console? (How are you going to get the answer to your computation back out?)
- theoh 12y agoOK, maybe I didn't make myself clear. Basically I am just saying that a "useless" pure functional language as characterised by Peyton Jones is equivalent to a souped-up desk calculator. You type an expression in (a form of IO provided by the runtime), you press Enter, and you get a value back. This is far from useless, nothing to he ashamed of. A "classic" bit of functional programming like Hutton's solution of the Countdown problem requires nothing more. http://www.cs.nott.ac.uk/~gmh/bib.html#countdown http://www.cs.nott.ac.uk/~gmh/bib.html#countdown I reckon a lot of people want to use that kind of machine, though it rules out systems programming. See for example the requirements expressed in this article: http://www.americanscientist.org/issues/pub/calculemus http://www.americanscientist.org/issues/pub/calculemus
- ZenoArrow 12y agoA desk calculator manipulates state, does it not?
- theoh 12y agoSo do the implementations of functional programming languages.
- ZenoArrow 12y agoAll the state-altering functions of Haskell are kept separate from the non-state-altering ones. That's what makes Haskell "pure functional" as opposed to "functional". The state-changing functions were designed after the non-state-changing ones, which is what we've been trying to tell you!
- theoh 12y agoGood grief. I said the _implementation_, not the language. They all use mutable state. Go read a paper. http://research.microsoft.com/apps/pubs/default.aspx?id=67083 http://research.microsoft.com/apps/pubs/default.aspx?id=6708...
- kenko 12y agoHow do you get the value back?
- cheepin 12y agoThe video certainly doesn't predate the IO monad, but the point was that Haskell was designed as an academic language with zero emphasis on practicality, and has grown in usefulness over time.
- ZenoArrow 12y ago"Are you saying the video predates the IO monad? I don't think that's true." No, I'm not saying that. Listen to the video... (3:34): Nevertheless, we put up with that embarrasment for many years until we figured out how to combine, in a single language, a single programming (...), we can combine effectful computations with effect-free ones, without making them pollute each other, right. The type system keeps them apart. (...) Can't quite make out this word, "methodology" perhaps? In any case, as you can hopefully see from reading that quote, SPJ is talking about the situation with Haskell in the past. Until they worked out how to do effectful computation in a pure functional language Haskell was basically useless, after they worked it out then Haskell was not useless. Do you understand what SPJ was saying now?
- theoh 12y agoHe is not saying that Haskell moved from the category of "Useless" to "Useful" (the spot on his diagram marked "Nirvana"), he is saying they are moving in that direction... But in any case that's not my point. I am arguing that Haskell was never useless in the first place. (You seem to be ignoring the substance of my comments, so continuing this thread is probably a waste of our time.)
- ZenoArrow 12y ago" I am arguing that Haskell was never useless in the first place." Okay, let's get break this down. The Haskell project was started in 1987. Version 1.0 of Haskell was released in 1990. Version 1.0 had no monads (they didn't come until version 1.3). If you had to code something that was both pure functional and useful in version 1.0, could you do it? "he is saying they are moving in that direction..." Yes, of course, because "useful" is a relative term. It's a goal, but the work on making a language more "useful" is never complete. The sketch is not important here, it's just a simple sketch, listen to SPJ's words.