[531] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: To-Do list..

daemon@ATHENA.MIT.EDU (Sat Nov 5 13:39:35 1994 )

To: coldstuff@MIT.EDU
In-Reply-To: Your message of "Sat, 05 Nov 1994 00:17:48 EST."
Date: Sat, 05 Nov 1994 11:41:52 EST
From: George Heintzelman <georgeh@MIT.EDU>

James Deikun tells us:
> > Atomic code blocks
> >   This is really needed now that we have suspend capability, and I will
> >   probably implement it as an 'atomic <statement>' syntax, i.e:
> >     atomic object.some_special_method();
> >   and
> >     atomic {
> >       do this;
> >       and this;
> >       and this too;
> >     }
> >   and etc..  If an attempt is made to suspend or pause while executing in an
> >   atomic state, an error will be thrown instead.
> It seems to me this construct isn't sufficiently general to amount
> to much.  It won't be worth the bytes it takes in the server in a
> multithreaded environment (it'd hold up *way* more tasks than
> necessary if it could even be implemented successfully at all,
> which is doubtful), and it doesn't allow for things like saving
> your state and proceeding to do the suspension--it's an all or
> nothing thing.  To me this is the major problem of the ColdMUD
> error handling system, which got fleshed out for me in a
> discussion of similar issues a while back in moo-cows.  It's based
> on LISP catch/throw, which was never really meant for error
> handling as such.  Without resumes, it's way too static, and it
> doesn't really support good stack unwinding right now either.
> These are more basic issues you need to be working on.

I agree with this analysis, and therefore tentatively suggest (well
aware that I'm just a lurker until life settles down and I can do some
Cold hacking again) the implementation of one of the most powerful and
underappreciated features of any programming language: 
	Scheme's Call-with-current-continuation.  Exactly how this
works is difficult to explain, but it basically packages up all of the
current stack, including the 'future' of the computation in progress,
and passes it off as an argument to the function which is an argument
of call/cc.  Using this mechanism, you can implement catch(), throw(),
pause(), callbacks, lisp's unwind-protect, and the list goes on and
on. It's a very general stack-handling mechanism. If you're curious for
details, you should consult a decent Scheme text.... As far as syntax,
for Cold's purposes, it'd have to have some new syntax, which I don't
have time to think about right now....

Anyway, just a thought from a lurking lispish-language fan...

George Heintzelman