[Haskell] Real life examples

George Russell ger at informatik.uni-bremen.de
Fri Nov 26 02:06:40 EST 2004

John Meacham wrote (snipped):
 > I should say that efficiency is the only thing I have been concerned
 > about in this conversation.

Well, I think my proposal can be made efficient if you try, using hash tables.

There is a reason why I think top-level <- is inefficient,
because it imposes a single scope for variables on the program; variables
really are global.  Imagine a very highly parallel program running on
lots of processors, then it will be important to make sure you do not have
all the processors having to constantly refer to the same global variable.
Really what you need is finer control over what copies of a variable each
processor uses, which is one reason why I think the extra indirection introduced
by my proposal is a good idea.

Consider for example Data.Unique.  If you are generating lots of unique identifiers
in a very highly parallel system it might well be much better for each processor to
generate its own and then add a processor identifier than to have to have a central
dispatcher which has to be consulted each time.

More information about the Haskell mailing list