Re: Functional Programming in the Larger or Functional Oriented Software Engineering

"Thomas F. Burdick" <[email protected]> Tue, 3 Apr 2007 10:30:47 +0200
Newsgroups gmane.comp.lang.lightweight
Message-ID <[email protected]>
On 4/2/07, Joe Marshall <[email protected]> wrote:
> On 3/31/07, Robbert Haarman <[email protected]> wrote:
> >
> > Err, did you just illustrate how not using mutation can be beneficial in
> > resource-constrained environments by introducing memoization and hash
> > tables, both of which involve mutation?!?!
>
> Yes I did.
>
> HOWEVER, unless you have a computer to which you continually add
> hardware, you will have mutation.  Mutation can exist at several levels of
> abstraction, and you can hide mutation behind an abstraction barrier
> so that the upper levels cannot observe it.  (For example, garbage collectors
> do this all the time.)

Haskell is a great example of the same thing.  Its evaluation rules
absolutely require mutation under the hood, much more so than in a
strict-evaluation language, where you could at least imagine a VM that
avoids mutation until it uses up all the machine's resources.  But
this under-the-hood mutation buys you a language with a lot less
mutation going on in user-space.