cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cardinal-dev] Continuation questions.


From: Dan Sugalski
Subject: Re: [Cardinal-dev] Continuation questions.
Date: Thu, 2 May 2002 10:29:21 -0400

At 12:40 PM +0200 5/2/02, Erik Bågfors wrote:
Hi all!

I was reading the perl6-internals mailinglist and I saw one thing that
confused me alot. I think the reason it did is my lack of understanding
of continuation!


I'm not on the perl6-internals list and I know Dan Sugalski is on this
list.  Here is a part from his mail regarding subroutines.

---------
3) We're having a new rule--you may *not* take a continuation from
within an opcode function! This is probably one of those "Well, Duh!"
things but better to have it up front.
---------

Either 1) I'm not understanding the concept of continuations at all or
2) This will totally break ruby on parrot.

Or 3) I wasn't clear about being an opcode function. :)

One of the things we're shooting for is to be able to have the
functions for opcodes (the stuff currently in core.ops) be writable
in Parrot assembly as well as C. If you're inside of one of those,
you can't take a continuation.

Or, to be more clear, assume you wrote the code to implement the
set_i_ic op. (The one that puts an integer constant inside an integer
register) In *that* function, you can't take a continuation. Inside
normal code--for example, inside a regular function, method call,
whatever--it's perfectly fine to take a continuation.

The thing I'm most concerned about, and the reason for the warning,
was the ramifications of taking a continuation on one side of the
C/Parrot barrier, and invoking it on the other. We can restore all of
Parrot's state properly, but we can't (well, aren't) do that for the
C stack. So if you've gone Parrot->C->Parrot, take a continuation,
then return back to the base parrot level, when you invoke the
continuation it'll think it's gone through C and out the other side,
when it really hasn't.

Make sense? If it turns out to be a massive problem, we'll work something out.
--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
address@hidden                         have teddy bears and even
                                      teddy bears get drunk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]