<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Code Reads #9: John Backus, &#8220;Can Programming Be Liberated&#8230;?&#8221;</title>
	<atom:link href="http://www.wordyard.com/2007/05/21/backus-liberated/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wordyard.com/2007/05/21/backus-liberated/</link>
	<description>Technology, politics, culture</description>
	<pubDate>Sun, 07 Sep 2008 12:11:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Anton Markov</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-692</link>
		<dc:creator>Anton Markov</dc:creator>
		<pubDate>Thu, 14 Jun 2007 21:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-692</guid>
		<description>An interesting example of functional languages used in the telecommunication industry is Erlang. It was first developed at and is mostly used by Ericsson.

Erlang white paper: http://www.erlang.org/white_paper.html

It is based around the concept of processes that communicate by passing messages to each-other. So while each process acts like a program in a functional language, there is some overall system state defined by the message queues of the processes.

It includes a lot of other features to support fault-tolerance, transparently accessing processes on distributed nodes, and dynamic code updates. Mostly features that are useful in distributed systems that must respond to many parallel queries.

In response to the comment by Cleo Saulnier above, Erlang is well-adapted to multi-core programming. Program logic is defined in a functional style, and the interpreter provides the "glue" that is necessary to communicate data between different CPUs, perform load-balancing, etc.

I am also surprised by Cleo's comment that, "none [of the FP principals] are taught in any school or university." I know at least two universities, Waterloo and MIT, that offer introductory CS courses in Scheme and provide an overview of FP in the process.</description>
		<content:encoded><![CDATA[<p>An interesting example of functional languages used in the telecommunication industry is Erlang. It was first developed at and is mostly used by Ericsson.</p>
<p>Erlang white paper: <a href="http://www.erlang.org/white_paper.html" rel="nofollow">http://www.erlang.org/white_paper.html</a></p>
<p>It is based around the concept of processes that communicate by passing messages to each-other. So while each process acts like a program in a functional language, there is some overall system state defined by the message queues of the processes.</p>
<p>It includes a lot of other features to support fault-tolerance, transparently accessing processes on distributed nodes, and dynamic code updates. Mostly features that are useful in distributed systems that must respond to many parallel queries.</p>
<p>In response to the comment by Cleo Saulnier above, Erlang is well-adapted to multi-core programming. Program logic is defined in a functional style, and the interpreter provides the &#8220;glue&#8221; that is necessary to communicate data between different CPUs, perform load-balancing, etc.</p>
<p>I am also surprised by Cleo&#8217;s comment that, &#8220;none [of the FP principals] are taught in any school or university.&#8221; I know at least two universities, Waterloo and MIT, that offer introductory CS courses in Scheme and provide an overview of FP in the process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Algorithmic or Arbitrary, Software's Great Divide &#187; Skillful Software</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-689</link>
		<dc:creator>Algorithmic or Arbitrary, Software's Great Divide &#187; Skillful Software</dc:creator>
		<pubDate>Tue, 29 May 2007 11:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-689</guid>
		<description>[...] topic first arose in a conversation I was having with Chris Conway over at Code Reads, exploring the pros and cons of functional programming. Chris said that he used FP every day, [...]</description>
		<content:encoded><![CDATA[<p>[...] topic first arose in a conversation I was having with Chris Conway over at Code Reads, exploring the pros and cons of functional programming. Chris said that he used FP every day, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cleo Saulnier</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-688</link>
		<dc:creator>Cleo Saulnier</dc:creator>
		<pubDate>Fri, 25 May 2007 21:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-688</guid>
		<description>Andrew: I'm not familiar with Prograph.  I went on wikipedia to see what was there and it appears to be a dataflow environment that works exactly as you specify.  Your statement "Operations could execute whenever all of their data was available" is right on target as to how dataflow can be made distributed.  I think there's power there (and I personally want to expand on the ideas of FBP) and many languages are starting to have their own version of this.  I believe 'arrows' are what they are called in Haskell for example.  This is yet another case of a data flow concept being called FP when it is far from being so.

As to the differences, FP does have an execution point while data flow does not.  It's just that it's very difficult to see because ALL data ALWAYS has an execution point in FP.  Because there is a one to one relationship between data and their transformation, you can control execution via its associated data relationships.  If one does not know better, they would think there's no execution and that this is the best you can get.  Unfortunately, the way functions are used, it cannot send data and leave it there for another 'entity' to do something with it.  I call this a side-effect, but there are some that believe otherwise because it only affects an external system.  A view I cannot agree with.  Yet, this leaving behind of data is the prime requirement for distributed computing.  Note that FP is fine for distributed delegation though.

So what is the difference in Map/Reduce?  With the data flow mechanism, you can input data at any time from any source.  The data flow network cares not where the data comes from.  To be pure FP, you cannot do this.  You need all the data before you can map it.  So that's why you have lazy lists and monads and all sorts of extensions to make these things fit more closely to the FP paradigm.  Some people believe that these things are in fact FP.  I do not because you have internal state changes.  In any case, no matter what you call it, there are things going on that are no different than imperative or data flow when it comes to communicating with the external world.</description>
		<content:encoded><![CDATA[<p>Andrew: I&#8217;m not familiar with Prograph.  I went on wikipedia to see what was there and it appears to be a dataflow environment that works exactly as you specify.  Your statement &#8220;Operations could execute whenever all of their data was available&#8221; is right on target as to how dataflow can be made distributed.  I think there&#8217;s power there (and I personally want to expand on the ideas of FBP) and many languages are starting to have their own version of this.  I believe &#8216;arrows&#8217; are what they are called in Haskell for example.  This is yet another case of a data flow concept being called FP when it is far from being so.</p>
<p>As to the differences, FP does have an execution point while data flow does not.  It&#8217;s just that it&#8217;s very difficult to see because ALL data ALWAYS has an execution point in FP.  Because there is a one to one relationship between data and their transformation, you can control execution via its associated data relationships.  If one does not know better, they would think there&#8217;s no execution and that this is the best you can get.  Unfortunately, the way functions are used, it cannot send data and leave it there for another &#8216;entity&#8217; to do something with it.  I call this a side-effect, but there are some that believe otherwise because it only affects an external system.  A view I cannot agree with.  Yet, this leaving behind of data is the prime requirement for distributed computing.  Note that FP is fine for distributed delegation though.</p>
<p>So what is the difference in Map/Reduce?  With the data flow mechanism, you can input data at any time from any source.  The data flow network cares not where the data comes from.  To be pure FP, you cannot do this.  You need all the data before you can map it.  So that&#8217;s why you have lazy lists and monads and all sorts of extensions to make these things fit more closely to the FP paradigm.  Some people believe that these things are in fact FP.  I do not because you have internal state changes.  In any case, no matter what you call it, there are things going on that are no different than imperative or data flow when it comes to communicating with the external world.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Rosenberg&#8217;s Wordyard &#187; Blog Archive &#187; Code Reads: Next up &#8212; Guy Steele</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-679</link>
		<dc:creator>Scott Rosenberg&#8217;s Wordyard &#187; Blog Archive &#187; Code Reads: Next up &#8212; Guy Steele</dc:creator>
		<pubDate>Fri, 25 May 2007 04:25:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-679</guid>
		<description>[...] pleased to see how many of you persevered through the long Code Reads drought and returned for the Backus discussion. Thank you all for sticking around. I am learning a lot from the comments, and you&#8217;ve renewed [...]</description>
		<content:encoded><![CDATA[<p>[...] pleased to see how many of you persevered through the long Code Reads drought and returned for the Backus discussion. Thank you all for sticking around. I am learning a lot from the comments, and you&#8217;ve renewed [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Conway</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-691</link>
		<dc:creator>Chris Conway</dc:creator>
		<pubDate>Thu, 24 May 2007 15:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-691</guid>
		<description>Andrew, I suspect we may be sailing right past the real divides between the "academic" and the "real" worlds, which are: (a) performance, and (b) what Joel Spolksy calls &lt;a href="http://www.joelonsoftware.com/items/2006/09/01.html" rel="nofollow"&gt;the language ecosystem&lt;/a&gt;, the giant stack of libraries and development tools that make it possible to develop modern, web-enabled, Unicode-aware, blah blah blah, software. I think that language developers are painfully aware of both of these issues.

As regards (a), things are Not That Bad. Take a look at the &lt;a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&#38;lang=all" rel="nofollow"&gt;language shootout numbers&lt;/a&gt; (grain of salt and all that), which show that OCaml, SML, and Haskell are all in the "reasonable" range between C and Java. If you go functional, you pay a small price in performance and a moderate price in coping with the static type system (and, in Haskell, a steep price in learning how to use monads to manage side effects) which yields a large savings in not having to debug crazy runtime errors (memory leaks, use-after-free, null pointers, etc.)

(b) is really a chicken-egg problem which won't get solved until a big corporation steps up and wills the ecosystem into existence. This may be happening right now with F#, which is a first-class citizen of the .NET kingdom. (Although the monarch of .NET is OOP, so F# may, in the end, gain the ecosystem, but lose its (functional) soul.)</description>
		<content:encoded><![CDATA[<p>Andrew, I suspect we may be sailing right past the real divides between the &#8220;academic&#8221; and the &#8220;real&#8221; worlds, which are: (a) performance, and (b) what Joel Spolksy calls <a href="http://www.joelonsoftware.com/items/2006/09/01.html" rel="nofollow">the language ecosystem</a>, the giant stack of libraries and development tools that make it possible to develop modern, web-enabled, Unicode-aware, blah blah blah, software. I think that language developers are painfully aware of both of these issues.</p>
<p>As regards (a), things are Not That Bad. Take a look at the <a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;lang=all" rel="nofollow">language shootout numbers</a> (grain of salt and all that), which show that OCaml, SML, and Haskell are all in the &#8220;reasonable&#8221; range between C and Java. If you go functional, you pay a small price in performance and a moderate price in coping with the static type system (and, in Haskell, a steep price in learning how to use monads to manage side effects) which yields a large savings in not having to debug crazy runtime errors (memory leaks, use-after-free, null pointers, etc.)</p>
<p>(b) is really a chicken-egg problem which won&#8217;t get solved until a big corporation steps up and wills the ecosystem into existence. This may be happening right now with F#, which is a first-class citizen of the .NET kingdom. (Although the monarch of .NET is OOP, so F# may, in the end, gain the ecosystem, but lose its (functional) soul.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sacamano</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-687</link>
		<dc:creator>Andrew Sacamano</dc:creator>
		<pubDate>Thu, 24 May 2007 02:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-687</guid>
		<description>Cleo, I'm curious about your assertion that MapReduce is not FP, but rather flow based.  I think this is along the lines of your earlier &lt;a href="http://www.wordyard.com/2007/01/05/parnas-sdi/#comment-28609" rel="nofollow"&gt;comments&lt;/a&gt; about eliminating the execution point.  This also seems to be quite consistent with the more pure strains of FP.  Can you say more about the difference?

Also, have you ever heard of a language called Prograph. Instead of writing code, a program was specified as a dataflow diagram, with data flowing along directed edges between nodes representing operations.  Operations could execute whenever all of their data was available, and execution order was unspecified - the whole thing was inherently parallelizable (provided you had a suitable algorithm), and once you got the hang of it, programmers could be very productive. Sadly, there are no current interpreters/compilers, but back in the day Prograph CPX was a fantastic development environment to work with.</description>
		<content:encoded><![CDATA[<p>Cleo, I&#8217;m curious about your assertion that MapReduce is not FP, but rather flow based.  I think this is along the lines of your earlier <a href="http://www.wordyard.com/2007/01/05/parnas-sdi/#comment-28609" rel="nofollow">comments</a> about eliminating the execution point.  This also seems to be quite consistent with the more pure strains of FP.  Can you say more about the difference?</p>
<p>Also, have you ever heard of a language called Prograph. Instead of writing code, a program was specified as a dataflow diagram, with data flowing along directed edges between nodes representing operations.  Operations could execute whenever all of their data was available, and execution order was unspecified - the whole thing was inherently parallelizable (provided you had a suitable algorithm), and once you got the hang of it, programmers could be very productive. Sadly, there are no current interpreters/compilers, but back in the day Prograph CPX was a fantastic development environment to work with.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Sacamano</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-682</link>
		<dc:creator>Andrew Sacamano</dc:creator>
		<pubDate>Thu, 24 May 2007 01:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-682</guid>
		<description>Chris - thank you for a very cogent and balanced assessment of FP. I've been looking for something this clear for a while.

And your comment &lt;em&gt;There seems to be a divide between academic, algorithmically-oriented programming and “real world” programming&lt;/em&gt; sparked an idea.  I was thinking that the distinction between "real world" and "academic" carries a lot of unnecessary baggage, and despite being somewhat convenient, obscures deeper issues.  Perhaps one cloud classify programming into three broad modes (bear with me a moment, please):

1) algorithmic - the raw manipulation of data is mathematical ways
2) conversational - the storage, retrieval, and transmission of data involving only basic manipulation
3) arbitrary - modeling external processes which where never designed to be algorithmic

In my daily work (I build "enterprise" applications, typically for large companies) 90% of what I face is conversational and arbitrary - moving data between systems with essentially straightforward syntax transformations, and following business processes which were never meant to be rational (as an engineer or mathematician understands "rational").

"Academic" software probably tends to be more algorithmic and conversational, since there is little that is intellectually interesting and rewarding in arbitrary software. Yet many other "real world" programmers also build software which is at its core highly algorithmic, and merely wrapped in arbitrary or conversational wrapper.  So Google's MapReduce would fall into this case, as would  Photoshop plugins, industrial optimization software, and so on.  This sounds like what your work involves as well.

Anyhow, I may have to take a look at OCaml.  It sounds like it might allow you to use FP approach for the algorithmic portions of your code, while using more imperative techniques for the rest.</description>
		<content:encoded><![CDATA[<p>Chris - thank you for a very cogent and balanced assessment of FP. I&#8217;ve been looking for something this clear for a while.</p>
<p>And your comment <em>There seems to be a divide between academic, algorithmically-oriented programming and “real world” programming</em> sparked an idea.  I was thinking that the distinction between &#8220;real world&#8221; and &#8220;academic&#8221; carries a lot of unnecessary baggage, and despite being somewhat convenient, obscures deeper issues.  Perhaps one cloud classify programming into three broad modes (bear with me a moment, please):</p>
<p>1) algorithmic - the raw manipulation of data is mathematical ways<br />
2) conversational - the storage, retrieval, and transmission of data involving only basic manipulation<br />
3) arbitrary - modeling external processes which where never designed to be algorithmic</p>
<p>In my daily work (I build &#8220;enterprise&#8221; applications, typically for large companies) 90% of what I face is conversational and arbitrary - moving data between systems with essentially straightforward syntax transformations, and following business processes which were never meant to be rational (as an engineer or mathematician understands &#8220;rational&#8221;).</p>
<p>&#8220;Academic&#8221; software probably tends to be more algorithmic and conversational, since there is little that is intellectually interesting and rewarding in arbitrary software. Yet many other &#8220;real world&#8221; programmers also build software which is at its core highly algorithmic, and merely wrapped in arbitrary or conversational wrapper.  So Google&#8217;s MapReduce would fall into this case, as would  Photoshop plugins, industrial optimization software, and so on.  This sounds like what your work involves as well.</p>
<p>Anyhow, I may have to take a look at OCaml.  It sounds like it might allow you to use FP approach for the algorithmic portions of your code, while using more imperative techniques for the rest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cleo Saulnier</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-678</link>
		<dc:creator>Cleo Saulnier</dc:creator>
		<pubDate>Wed, 23 May 2007 23:35:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-678</guid>
		<description>The paper does have relevance.  The thing that I find strange is that no one seems to understand the core properties that makes FP possible.  For example, above, you see someone mentioning Map/Reduce as if it's something that has to do with FP.  It does not.  Map/Reduce is a flow based concept, not functional.  The version used in FP is a limited version of it.  Unfortunately, because the term 'function' has never been properly defined, the FP community saw it fit to associate anything under the sun to FP.  Sad, but true.

And to John:  I have never said I did not understand FP.  There's nothing in that paper or about FP that is even remotely foreign to me.  What I've said about FP is that it's an inconsistant system that cannot interact with external systems without breaking its own rules.  For that reason, FP has serious limitations and is useless for the future of multiprocessing.  This is the 'glue' code that most real life programmers need.  FP doesn't provide it.  And it's simple to see why if you understand the underlying principles... of these, none are taught in any school or university.

For something that is supposed to be simple, the terminology is left open-ended so that credit can be taken when it's not appropriate to do so.  Map/Reduce being the biggest example.

I'm not saying these things to be contentious either.  It's because there are too many programmers attached to a certain PL or programming system.  Why is this?  I do not care what I use just as long as it works.  So I'm pointing out what's really going on.  On my blog, I get too many that think I'm emotionally caught up.  I have no idea where this comes from because I dislike all languages equally.  I use what works.  Show me that it works regardless of terminology and I'll use it.  Otherwise, in /dev/null it goes.  Guess where FP is.</description>
		<content:encoded><![CDATA[<p>The paper does have relevance.  The thing that I find strange is that no one seems to understand the core properties that makes FP possible.  For example, above, you see someone mentioning Map/Reduce as if it&#8217;s something that has to do with FP.  It does not.  Map/Reduce is a flow based concept, not functional.  The version used in FP is a limited version of it.  Unfortunately, because the term &#8216;function&#8217; has never been properly defined, the FP community saw it fit to associate anything under the sun to FP.  Sad, but true.</p>
<p>And to John:  I have never said I did not understand FP.  There&#8217;s nothing in that paper or about FP that is even remotely foreign to me.  What I&#8217;ve said about FP is that it&#8217;s an inconsistant system that cannot interact with external systems without breaking its own rules.  For that reason, FP has serious limitations and is useless for the future of multiprocessing.  This is the &#8216;glue&#8217; code that most real life programmers need.  FP doesn&#8217;t provide it.  And it&#8217;s simple to see why if you understand the underlying principles&#8230; of these, none are taught in any school or university.</p>
<p>For something that is supposed to be simple, the terminology is left open-ended so that credit can be taken when it&#8217;s not appropriate to do so.  Map/Reduce being the biggest example.</p>
<p>I&#8217;m not saying these things to be contentious either.  It&#8217;s because there are too many programmers attached to a certain PL or programming system.  Why is this?  I do not care what I use just as long as it works.  So I&#8217;m pointing out what&#8217;s really going on.  On my blog, I get too many that think I&#8217;m emotionally caught up.  I have no idea where this comes from because I dislike all languages equally.  I use what works.  Show me that it works regardless of terminology and I&#8217;ll use it.  Otherwise, in /dev/null it goes.  Guess where FP is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Conway</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-677</link>
		<dc:creator>Chris Conway</dc:creator>
		<pubDate>Wed, 23 May 2007 16:11:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-677</guid>
		<description>Andrew said: &lt;em&gt;strict adherence to the core idea of functional programming - everything being a function, and the complete elimination of side-effects - make 90% of programming much harder.&lt;/em&gt;

The consensus of the FP community is pretty much the opposite: that "pure" FP makes 90% of your work easier (and safer), while making things like I/O much harder. If your project is 90% I/O (and many projects are!), your experience will differ.

There seems to be a divide between academic, algorithmically-oriented programming and "real world" programming, where it seems most development effort is spent writing "glue" between pre-existing systems. The assumption seems to be that this "glue" is always ugly and non-algorithmic, and consistently resists any attempts at generalization and elegance.

I have no idea if this is true and I'm not going to wave my hands and pretend otherwise. But I suspect there will always be a place for C programming (at the systems level) and Perl programming (at the shell level), even as more and more programmers move to higher-level and FP-ish languages.</description>
		<content:encoded><![CDATA[<p>Andrew said: <em>strict adherence to the core idea of functional programming - everything being a function, and the complete elimination of side-effects - make 90% of programming much harder.</em></p>
<p>The consensus of the FP community is pretty much the opposite: that &#8220;pure&#8221; FP makes 90% of your work easier (and safer), while making things like I/O much harder. If your project is 90% I/O (and many projects are!), your experience will differ.</p>
<p>There seems to be a divide between academic, algorithmically-oriented programming and &#8220;real world&#8221; programming, where it seems most development effort is spent writing &#8220;glue&#8221; between pre-existing systems. The assumption seems to be that this &#8220;glue&#8221; is always ugly and non-algorithmic, and consistently resists any attempts at generalization and elegance.</p>
<p>I have no idea if this is true and I&#8217;m not going to wave my hands and pretend otherwise. But I suspect there will always be a place for C programming (at the systems level) and Perl programming (at the shell level), even as more and more programmers move to higher-level and FP-ish languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Conway</title>
		<link>http://www.wordyard.com/2007/05/21/backus-liberated/#comment-690</link>
		<dc:creator>Chris Conway</dc:creator>
		<pubDate>Wed, 23 May 2007 15:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.wordyard.com/?p=1293#comment-690</guid>
		<description>&lt;em&gt;Being a bit of a devil’s advocate, where are the FP proponents?&lt;/em&gt;

OK, I'll bite. First of all, I must note: I am an academic, so my experience is not indicative of software engineering "in the trenches."

I love FP. I program almost every day in OCaml, a primarily-functional mixed-paradigm language descended from ML. The nice thing about OCaml is it gives you access to the things about FP that make it nice and fun, while giving you recourse to imperative features (mutable variables) and an object system where necessary.

But of course it is exactly its these features that make OCaml non-"functional", in the sense that Backus is advocating. What he seems primarily concerned with is "equational reasoning" and "&lt;a href="http://en.wikipedia.org/wiki/Referential_transparency" rel="nofollow"&gt;referential transparency&lt;/a&gt;": the desire to reason about and manipulate a program definition as if it were an algebraic entity. The only significant language I know of that supports "pure" FP in this sense is Haskell and its industrial adoption is close to (if not precisely) nil.

The main complaints I hear about FP in practice are not that it is impenetrable (it can be, but the combinatory style that Backus uses is discouraged; it is possible to give intermediate values names without introducing mutable variables!), but that:

(1) It is too abstract, in the sense that it can be hard to imagine the performance characteristics of the generated code from looking at the source. E.g., in OCaml, it is important to understand tail recursion if you don't want your algorithms to crap out on large data structures. In Haskell, due to lazy evaluation, there are subtle ways to make the memory usage of a program explode (and one of those ways, it seems, is to use tail recursion!). In contrast, even in Java, the translation from source code to bytecode is straight-forward enough for the programmer to understand and reason about directly.

(2) Massaging a program through the type system is challenging. For one, the inferring type systems give bizarre and unhelpful error messages. For another, the subtle ways that modules and objects (in OCaml), type classes and monads (in Haskell), and parametric polymorphism (in both) interact is very difficult to learn and master. The payoff is you completely eliminate a broad class of runtime type errors (anything to do with pointers, or downcasting in Java).

The features that Neel listed as having trickled from FP to the mainstream&#8212;"garbage collection, type inference, parametric polymorphism (aka Java generics), first-class functions, list comprehensions"&#8212;none of these have much or anything to do with functional programming at all! (First-class functions are necessary, but not sufficient, to make a language "functional".) These are just advanced language features that appeared first in the FP community for exactly the reason Neel cited: FP is where cutting edge language research happens.

P.S. For an even more dramatic example of the migration of PL ideas into practice, see Microsoft's &lt;a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="nofollow"&gt;LINQ&lt;/a&gt; language. Its creator spent more than a decade hacking on Haskell. See also &lt;a href="http://www.haskell.org/sitewiki/images/0/03/TMR-Issue7.pdf" rel="nofollow"&gt;here&lt;/a&gt; for an article on OCaml's use in the finance industry.

P.P.S. What's with the no comment preview? I'm pretty sure this is going to be typo-rific.</description>
		<content:encoded><![CDATA[<p><em>Being a bit of a devil’s advocate, where are the FP proponents?</em></p>
<p>OK, I&#8217;ll bite. First of all, I must note: I am an academic, so my experience is not indicative of software engineering &#8220;in the trenches.&#8221;</p>
<p>I love FP. I program almost every day in OCaml, a primarily-functional mixed-paradigm language descended from ML. The nice thing about OCaml is it gives you access to the things about FP that make it nice and fun, while giving you recourse to imperative features (mutable variables) and an object system where necessary.</p>
<p>But of course it is exactly its these features that make OCaml non-&#8221;functional&#8221;, in the sense that Backus is advocating. What he seems primarily concerned with is &#8220;equational reasoning&#8221; and &#8220;<a href="http://en.wikipedia.org/wiki/Referential_transparency" rel="nofollow">referential transparency</a>&#8220;: the desire to reason about and manipulate a program definition as if it were an algebraic entity. The only significant language I know of that supports &#8220;pure&#8221; FP in this sense is Haskell and its industrial adoption is close to (if not precisely) nil.</p>
<p>The main complaints I hear about FP in practice are not that it is impenetrable (it can be, but the combinatory style that Backus uses is discouraged; it is possible to give intermediate values names without introducing mutable variables!), but that:</p>
<p>(1) It is too abstract, in the sense that it can be hard to imagine the performance characteristics of the generated code from looking at the source. E.g., in OCaml, it is important to understand tail recursion if you don&#8217;t want your algorithms to crap out on large data structures. In Haskell, due to lazy evaluation, there are subtle ways to make the memory usage of a program explode (and one of those ways, it seems, is to use tail recursion!). In contrast, even in Java, the translation from source code to bytecode is straight-forward enough for the programmer to understand and reason about directly.</p>
<p>(2) Massaging a program through the type system is challenging. For one, the inferring type systems give bizarre and unhelpful error messages. For another, the subtle ways that modules and objects (in OCaml), type classes and monads (in Haskell), and parametric polymorphism (in both) interact is very difficult to learn and master. The payoff is you completely eliminate a broad class of runtime type errors (anything to do with pointers, or downcasting in Java).</p>
<p>The features that Neel listed as having trickled from FP to the mainstream&mdash;&#8221;garbage collection, type inference, parametric polymorphism (aka Java generics), first-class functions, list comprehensions&#8221;&mdash;none of these have much or anything to do with functional programming at all! (First-class functions are necessary, but not sufficient, to make a language &#8220;functional&#8221;.) These are just advanced language features that appeared first in the FP community for exactly the reason Neel cited: FP is where cutting edge language research happens.</p>
<p>P.S. For an even more dramatic example of the migration of PL ideas into practice, see Microsoft&#8217;s <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="nofollow">LINQ</a> language. Its creator spent more than a decade hacking on Haskell. See also <a href="http://www.haskell.org/sitewiki/images/0/03/TMR-Issue7.pdf" rel="nofollow">here</a> for an article on OCaml&#8217;s use in the finance industry.</p>
<p>P.P.S. What&#8217;s with the no comment preview? I&#8217;m pretty sure this is going to be typo-rific.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
