At 09:30 AM 12/1/2001 -0800, Brent Dax wrote:
>First of all, you sent us this already.  :^)
>
>Jeff 'japhy' Pinyan:
># I'm writing a simple language to embody the concept of
># copy-on-write, and
># so that I can learn how to implement it.  The language is
># called COW and
># it's at
>#
>#   http://japhy.perlmonk.org/COW/
>#
># Ben Tilly suggested I contact the Perl6 Internals folk and
># let you know
># that this is an important feature that we should try to
># incorporate into
># Perl 6.
>
>Don't worry, CoW is going in--Dan's been raving about it since the
>beginning.  :^)

I have *Not*. I've been ranting about it--that's something completely 
different. ;-P

># So what's copy-on-write?  Basically, it's the use of a
># pointer until that
># use becomes unsafe.
>....
># And that's that.  The language will take me a while to
># develop and all,
># but I'm interested in helping out as much as I can to integrate COW in
># Perl 6 -- it'll be a good idea, I feel.
>
>Internals hackers:  Implementation-wise, I'm thinking we have a wrapper
>PMC and vtable, with the original PMC in SELF->data and some metadata in
>SELF->cache.struct_val; get operations just call the equivalent op in
>the wrapee's vtable, while set operations tell all the dependencies to
>copy their data, replace the wrapper with the wrapee, and call through
>the new vtable.

For GC reasons, we're better off pushing this down a level into the buffer 
structures, and play games with the string op functions instead. It will 
make GC more interesting, since we need to track pointers into buffers that 
don't really belong to the buffer structure. Or we could just not, and do 
other odd things. (Like be shared until a GC run and expand out at that 
point, but I don't know that we'd want to)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to