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

Re: A plea for a new old language




Could you post a rough example of a sequence of transfer-of-control VM
instructions using CPS, and note why its beneficial?

Thanks!

Eli


On Fri, 9 May 2003, Dan Sugalski wrote:

> At 3:13 PM -0700 5/8/03, Michael Vanier wrote:
> >Maybe I'm missing something, but I don't see how to do CPS in C.
> >How do you create the continuation inside a function?
>
> I'm not doing CPS for C code--there's a limit to how nuts I care to be. :)
>
> Rather, the CPS stuff I'm considering is at the VM level, where the
> VM's transfer-of-control uses a form of CPS. So the C code is just C
> code, but the sequence of VM instructions a compiler emits does the
> CPS thing. I'm working on more details, and I'm getting more and more
> convinced as I do this that CPS is the right way to go, suitably
> cloaked with a good soft sell for folks.
>
> >  > Date: Thu, 8 May 2003 11:27:31 -0400 (EDT)
> >>  From: "Kevin Kelleher" <kkell@znet.com>
> >>
> >>  Dan,
> >>
> >>  The material on the Parrot website is quite interesting.
> >>  I don't think that CPS would be hard to justify:  you
> >>  could probably get away with saying that it would make
> >>  Parrot able to handle a wider variety of languages
> >>  and programming styles.
> >>
> >>  Since you're using C, could you simply prepare a template
> >>  or templates for coders who know not CPS?  Maybe
> >>  "template" is not the right word; what I mean is
> >>  files that have the CPS stuff in place and comments
> >  > like  /*** YOUR CODE GOES HERE ***/
>
> --
>                                          Dan
>
> --------------------------------------"it's like this"-------------------
> Dan Sugalski                          even samurai
> dan@sidhe.org                         have teddy bears and even
>                                        teddy bears get drunk
>
>