On 10-May-2000, Sverker Nilsson <[EMAIL PROTECTED]> wrote:
> 
> Relevance for Haskell would be that you wouldnt be able to fork a
> program written in C into a protected environment (functional
> sandbox?) and know that its result would depend only on its input
> arguments. So you couldnt safely do this thru an ordinary Haskell
> function call that could be cached for example.

Well, you don't have that guarantee anyway.
C has many areas of undefined and/or unspecified behaviour.
There is no guarantee that C code will be deterministic.
So do operating system ABIs.  Even hardware architectures often have
areas of undefined and/or unspecified behaviour.

To give you a practical example: on SPARCs, the contents of
uninitialized stack slots are unspecified, and in practice they are
nondeterministic.  This happens because the SPARC's register windows
get flushed to the stack when a context switch occurs, and the timing
of context switches is in general nondeterministic.  If you write a C
program that examines uninitialized stack slots -- for example one
using a conservative garbage collector -- then the program's exact
behaviour can be nondeterministic.  (This has bitten me in the past.)

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.

Reply via email to