cardinal-dev
[Top][All Lists]
Advanced

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

Re: [Cardinal-dev] Continuation questions.


From: Erik Bågfors
Subject: Re: [Cardinal-dev] Continuation questions.
Date: 02 May 2002 20:20:46 +0200

On Thu, 2002-05-02 at 16:29, Dan Sugalski wrote:
> 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. :)

Ahh .. the magic third choice.  :)

> 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.

Ahh.. now I see.  That makes perfect sense :)  I assume "Inside normal
code" includes inside C-code as well?
 
> 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.
> -- 

Yes!  Thank you for explaining that.

Any idea when you will have function/method calls working in parrot? :)

/Erik

-- 
Erik Bågfors               | address@hidden
Supporter of free software | GSM +46 733 279 273
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32



reply via email to

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