[Haskell-cafe] Why?

Richard O'Keefe ok at cs.otago.ac.nz
Thu Dec 10 19:03:43 EST 2009


On Dec 11, 2009, at 1:01 AM, John D. Earle wrote:

> This is a matter that I genuinely at the present time do not grasp  
> and I am hoping that some of you who are more familiar with the  
> Haskell language may be able to help enlighten me. I feel the  
> question to be an important one. What material benefit does Haskell  
> derive from being a "pure" functional language as opposed to an  
> impure one? Please provide examples as I require instruction.

It sounds as though you think the Haskell designers wanted a language  
for
some other reason, then cast around and said "what kind of language  
will it
be?" and decided to make it a pure lazy functional one.

It's the other way around.  The programming language world was full of
people trying all sorts of things.  It so happened that several groups
were exploring techniques for implementing pure lazy functional  
languages.
In a fit of sanity that gives one hope for humanity, they said "why  
don't
we all work on a *common* language?"

The big outsider was Clean, which, however, adopted quite a lot of  
things
from Haskell, and now has or is aquiring a Haskell98 front end.  (It was
already close enough to Haskell that the biggest pain in converting was
that 'if' is just a plain function in Clean, not special syntax.)

The question to ask, then, is "what material benefit did the pure lazy
functional language community get from adopting a common language".
Here's one hint:  there are several Haskell implementations, numerous
Haskell books, and a bulging library of reusable Haskell code.  There's
basically one out of date Clean book and an unfinished one available on
the web.

As for why anyone should care about pure functional languages,
read "Why Functional Programming Matters".

Oddly enough, the W3C language for transforming XML (XSLT) is a pure
functional language, and so is the C++ type system.

> The sort of decision that Apple computer and Microsoft made not to  
> go down the POSIX road seems relevant.

(1) When the Mac was designed, POSIX did not exist.  They _couldn't_
     go down the POSIX road.
(2) Apple computer *did* go down the POSIX road, or very nearly.
     MacOS X is as good a UNIX as ever came down the street.  It's also
     a lot *more* than POSIX, but I routinely expect to have no more
     trouble moving code from say Solaris to MacOS than to Linux;
     sometimes less.
(3) Since the release of Windows NT, Microsoft *have* gone down the  
POSIX
     road.  I have Microsoft's "Services for Unix Applications"  
installed
     on a laptop.  What Microsoft don't seem to be very interested in is
     going down the C99 road.  Like Mac OS X, Windows is a lot *more*
     than POSIX.

I suggest that one reason for functional language implementation
researchers to concentrate on a *pure* functional language is to keep
themselves honest:  whenever a performance problem comes up it's no
good saying "oh we'll do this the old fashioned imperative way" (as
SML and O'Caml do), they have to find a way to do it well  
_functionally_.



More information about the Haskell-Cafe mailing list