[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: functional languages ill-suited for large programs?




Alan Bawden <Alan@LCS.MIT.EDU> writes:
>    But what if I needed to be able to forget old memoized values?
> 
> Then you'd be moving the goal posts!  What you -said- was that a functional
> language prevented you from expressing memoization.  Now you've changed
> your tune!

You're right!  Sorry.  :) I was thinking in the context of the
original question, but that's not what I wrote.

> Well, I wasn't trying to rebut your overall argument nor was I trying to
> claim that concealed state isn't useful.  I was just pointing out that your
> -specific- claim (that functional languages prevent you from expressing
> memoization) isn't true.

It certainly isn't.  The standard lazy replace-thunk-with-value
mechanism matches caching the results of expensive computations
perfectly.

> I was also indirectly making the point that it can be surprising what -can-
> be expressed in a functional language.  I think you're right that state is
> indispensable in many situations.  But I'm not as certain as I used to be
> about exactly what those situations are, I've been surprised too often...

That is very encouraging to hear.

But I think if we programmers as a group could simply get over our
obsession with actually *running* our programs, then we could forget
altogether about how well the language implementation we wanted to use
controlled the particular machines we have in front of us.  I think
great things would come of it.