[Haskell-cafe] Re: [Haskell] Top Level <-

Adrian Hey ahey at iee.org
Sat Aug 30 10:02:22 EDT 2008


Adrian Hey wrote:
> "Global variables" are needed to ensure important safety properties,
> but the only reasons I've seen people give for thread local variables
> is that explicit state threading is just so tiresome and ugly. Well
> that may be (wouldn't disagree), but I'm not aware of any library
> that simply couldn't be implemented without them.

I thought I ought to say a bit more about my unkind and hasty
words re. thread local variables. This is discussed from time to
time and there's a wiki page here sumarising proposals...

  http://www.haskell.org/haskellwiki/Thread-local_storage

One thing that worries me is that nobody seems to know what problem
thread local storage is solving, hence diversity of proposals. I'm
also a struggling to see why we need it, but I don't have any passionate
objections to it either.

Unfortunately for those of us that want a solution to the "global
variables" problem the two issues seem have been linked as being the
part of same problem, so while there's all this uncertainty about what
thread local variables are actually going to be used for and what they
should look like the (IMO) much simpler "global variables"
problem/solution is in limbo. This has been going on 4 or 5 years now
IIRC.

But the "global variables" problem is really much simpler. All we
want is something that does exactly what the unsafePerformIO hack
currently does (assuming flag/pragma hackery does the trick), but
does it reliably. (IMO, YMMV..)

Regards
--
Adrian Hey



More information about the Haskell-Cafe mailing list