[mercury-users] declarative kernels

Thomas Conway conway at cs.mu.OZ.AU
Tue Mar 7 09:12:33 AEDT 2000

On Mon, Mar 06, 2000 at 09:22:26PM EST, Ralph Becket wrote:
> > From: Thomas Conway [mailto:conway at cs.mu.OZ.AU]
> > 
> > There are two interpretations of the io__state.
> > 
> > The first, proposed by Fergus, is that the io__state 
> > represents the state
> > of the external world, and that I/O operations modify the 
> > external state.
> > This has the drawback that if, for example someone else on the system
> > removes a file between when you finished writing it, and when 
> > you go to
> > read it again, then the act of closing the file has to 
> > implicitly remove
> > it as well, which is a bit strange, but it is a fairly simple model.
> Oh, that's not my interpretation of what Fergus said.  I thought Fergus
> was advocating the idea of an io__state being a *view* of the external
> world - that is, it keeps track of what your program has attempted to do
> to the outside world, rather than being a reflection of the actual state
> of the outside world.  This means that just because you wrote something 
> to a file, there's no guarantee that that's what you'll read back in.

The catch is, that the io__state as the state of the exterrnal world
view doesn't come with a simple mechanism to account for you not being
the only thing changing the world. The list of interactions view does.

> > More recently I proposed an interpretation that owes a lot to 
> > concurrent
> > logic programming, where the io__state represents a list of 
> > interactions
> > with the external world. The io__state pair represents a 
> > difference list
> > (in the Prolog sense), with the second io__state representing the I/O
> > operations that come "after".
> This is an appealing picture, but I don't see how it takes exogenous
> events into account (e.g. someone else unexpectedly deleting a file).
> Unless, of course, your_main/2 below is the merge of everybody else's
> IO operations, too.


 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list