RFC: Foreign objects in perl

2000-08-02 Thread Dan Sugalski
=head1 TITLE A method of allowing foreign objects in perl =head1 VERSION Maintainer: Dan Sugalski <[EMAIL PROTECTED]> Date: August 02, 2000 Version: 1 Mailing List: perl6-internals Number: XXX =head1 ABSTRACT Currently it's a darned pain to deal with objects creat

Re: RFC: Foreign objects in perl

2000-08-02 Thread John Tobey
[un-CC'ed to librarian - is this correct procedure?] Dan Sugalski <[EMAIL PROTECTED]> wrote: > > =head1 TITLE > > A method of allowing foreign objects in perl I like it. > =head1 VERSION > > Maintainer: Dan Sugalski <[EMAIL PROTECTED]> > Date: A

Re: RFC: Foreign objects in perl

2000-08-02 Thread Dan Sugalski
he struct that evolved in Perlmacs for mixing >Perl and ELisp objects: Feel free to define some recommended functions. Give 'em all upper-case names so they don't get confused with real methods. (I hope) A PERL_ prefix might not be a bad thing either. On the other hand, we may have a

Re: RFC: Foreign objects in perl

2000-08-02 Thread John Tobey
we call the destroy method > and assume that everything hanging off the object pointer is gone. That > only leaves the perl bits to clean up, and we know about those. Don't assume that the Perl interpreter is the sole root of accessibility. Maybe some other language has 'us'

Re: RFC: Foreign objects in perl

2000-08-02 Thread Ken Fox
rs and booleans) directly into the "SV *" that seems like a big win. For foreign objects, I'm not sure why you're forcing a two level dispatch. Why not let the foreign code register dispatches directly in the scalar's vtbl? If we did it that way, a foreign object is just: [

Re: RFC: Foreign objects in perl

2000-08-03 Thread Dan Sugalski
sts in perl 5? No. Some magic cookie that perl's internals passes to extension code? Yep, you bet. Probably should've used PMC instead of SV * to distinguish them. As for returning refs rather than real objects, well, I'm not sure that we want to do that, but some sort of decouplin

Re: RFC: Foreign objects in perl

2000-08-03 Thread Benjamin Stuhl
--- Dan Sugalski <[EMAIL PROTECTED]> wrote: > actual work. The > dispatch routine has a function signature like so: > > int status = dispatch(void *native_obj, sv > *perl_scalar, char *method_called, > int *num_args_in, perl_arg_stack > *arg_stack, >

Re: RFC: Foreign objects in perl

2000-08-03 Thread Dan Sugalski
assume that the Perl interpreter is the sole root of >accessibility. Maybe some other language has 'us' (i.e., the >interpreter) as an object and needs to mark all its own objects that >we refer to for the benefit of its own GC. Right, and I'm not. The destroy method is r

Re: RFC: Foreign objects in perl

2000-08-03 Thread John Tobey
Dan Sugalski <[EMAIL PROTECTED]> wrote: > > > Feel free to define some recommended functions. Give 'em all upper-case > > > names so they don't get confused with real methods. (I hope) A PERL_ > > prefix > > > might not be a bad thing either. > > > >The only one I feel strongly about here is TYPE

Re: RFC: Foreign objects in perl

2000-08-03 Thread Dan Sugalski
At 08:22 AM 8/3/00 -0700, Benjamin Stuhl wrote: >--- Dan Sugalski <[EMAIL PROTECTED]> wrote: > > actual work. The > > dispatch routine has a function signature like so: > > > > int status = dispatch(void *native_obj, sv > > *perl_scalar, char *method_called, > > int *num_ar

Re: RFC: Foreign objects in perl

2000-08-03 Thread Dan Sugalski
At 11:51 AM 8/3/00 -0400, John Tobey wrote: >Dan Sugalski <[EMAIL PROTECTED]> wrote: > > > > Feel free to define some recommended functions. Give 'em all upper-case > > > > names so they don't get confused with real methods. (I hope) A PERL_ > > > prefix > > > > might not be a bad thing either. >

Re: RFC: Foreign objects in perl

2000-08-03 Thread John Tobey
Dan Sugalski <[EMAIL PROTECTED]> wrote: > What, doing a > >name = (PMC->vtable[NAME])(PMC); > > is inflexible? I'm not talking about embedding data into the vtable, rather > make one of the table entries a pointer to a function that returns the type > name. Oh, cool. I misunderstood you.

Re: RFC: Foreign objects in perl

2000-08-03 Thread Bart Schuller
On Thu, Aug 03, 2000 at 08:22:28AM -0700, Benjamin Stuhl wrote: > One thing: remember, there is a lot of talk about having > perl6 use Unicode internally, which means that things like > method names should be wchar_t * (or whatever). No, that's the beauty of utf8: the C datatype is still char* an

Re: RFC: Foreign objects in perl

2000-08-03 Thread Benjamin Stuhl
--- Bart Schuller <[EMAIL PROTECTED]> wrote: > On Thu, Aug 03, 2000 at 08:22:28AM -0700, Benjamin Stuhl > wrote: > > One thing: remember, there is a lot of talk about > having > > perl6 use Unicode internally, which means that things > like > > method names should be wchar_t * (or whatever). > >

Re: RFC: Foreign objects in perl

2000-08-03 Thread Simon Cozens
On Thu, Aug 03, 2000 at 01:15:54PM -0400, Dan Sugalski wrote: > >One thing: remember, there is a lot of talk about having > >perl6 use Unicode internally, which means that things like > >method names should be wchar_t * (or whatever). > > Good point. I shall have to think Unicode more. (UTF-32, a

Re: RFC: Foreign objects in perl

2000-08-03 Thread Simon Cozens
On Thu, Aug 03, 2000 at 08:50:56PM +0200, Bart Schuller wrote: > No, that's the beauty of utf8: the C datatype is still char* and as long > as you stick to 7-bits ASCII you won't know the difference... ... other than the fact that it's painfully slow to handle. (Wow, middle of a character! Where

Re: RFC: Foreign objects in perl

2000-08-03 Thread John Tobey
Simon Cozens <[EMAIL PROTECTED]> wrote: > On Thu, Aug 03, 2000 at 01:15:54PM -0400, Dan Sugalski wrote: > > >One thing: remember, there is a lot of talk about having > > >perl6 use Unicode internally, which means that things like > > >method names should be wchar_t * (or whatever). > > > > Good p

Re: RFC: Foreign objects in perl

2000-08-03 Thread John Tobey
f the object > > > pointer is gone. That only leaves the perl bits to clean up, and > > > we know about those. > > > >Don't assume that the Perl interpreter is the sole root of > >accessibility. Maybe some other language has 'us' (i.e., the >

Re: RFC: Foreign objects in perl

2000-08-03 Thread Ken Fox
on't be found. There's a lot of talk about doing a mark-sweep collector for perl, but I'm not sure adopting a 30 year old obsolete gc algorithm is such a good idea. Certainly we have to be careful about moving objects, but generational collectors have a lot of advantages we should

Re: RFC: Foreign objects in perl

2000-08-03 Thread John Tobey
I think we are trying to accommodate any of several GC systems to be selected amongst in future. Ken Fox <[EMAIL PROTECTED]> wrote: > John Tobey wrote: > > Picture this. A Lisp (or Java, ...) structure holds a Perl > > interpreter. A Perl variable holds a reference to the Lisp structure. > > St

Re: RFC: Foreign objects in perl

2000-08-03 Thread Ken Fox
John Tobey wrote: > I think we are trying to accommodate any of several GC systems to be > selected amongst in future. Then the Perl API needs to allow for the GC to move objects. If that can't happen, the majority of interesting collectors can't be used. > Ken Fox <[E

Re: RFC: Foreign objects in perl

2000-08-03 Thread Brock
On Fri, 4 Aug 2000, Ken Fox wrote: > John Tobey wrote: ... > There's a lot of talk about doing a mark-sweep collector for perl, > but I'm not sure adopting a 30 year old obsolete gc algorithm is > such a good idea. Certainly we have to be careful about moving >

Re: RFC: Foreign objects in perl

2000-08-04 Thread Ken Fox
Dan Sugalski wrote: DS> TheObj *foo; DS> SV *new_sv; DS> foo = new TheObj("A parameter"); DS> sv = perl_new_sv(); DS> perl_make_sv_object(sv, "Some::Package", foo, &dispatch_routine, DS> &destroy_routine); DS> DS> perl_return(perl_make_re

Re: RFC: Foreign objects in perl

2000-08-04 Thread John Tobey
Ken Fox <[EMAIL PROTECTED]> wrote: > John Tobey wrote: > > I think we are trying to accommodate any of several GC systems to be > > selected amongst in future. > > Then the Perl API needs to allow for the GC to move objects. If that > can't happen, the majority

Re: RFC: Foreign objects in perl

2000-08-05 Thread Nick Ing-Simmons
Benjamin Stuhl <[EMAIL PROTECTED]> writes: >--- Dan Sugalski <[EMAIL PROTECTED]> wrote: >> actual work. The >> dispatch routine has a function signature like so: >> >> int status = dispatch(void *native_obj, sv >> *perl_scalar, char *method_called, >> int *num_args_in, perl

Re: RFC: Foreign objects in perl

2000-08-05 Thread Dan Sugalski
John Tobey wrote: > Picture this. A Lisp (or Java, ...) structure holds a Perl > interpreter. A Perl variable holds a reference to the Lisp structure. > Structure and interpreter become inaccessible to all threads. Perl > will never know it's done with the Lisp structure, neither Perl nor

Re: RFC: Foreign objects in perl

2000-08-05 Thread Dan Sugalski
At 03:29 AM 8/4/00 -0400, Ken Fox wrote: >Dan Sugalski wrote: > > Your extended way's cool too--RFC it and we can do that as well. > >I've been wanting to. It would be nice (at least for me) for you to >start suggesting more RFC "assignments" like this. Community is not >the same as "no ownership"

Re: RFC: Foreign objects in perl

2000-08-06 Thread John Tobey
| | | |-+-| If Perl uses reference-counting as its only garbage collection, this loop will have to be broken explicitly. But if we anticipate possibly implementing mark-and-sweep, our mark routine should call Lisp's mark routine on those Lisp objects we still reference, which would allow those we don't to be collected. -John

Re: RFC: Foreign objects in perl

2000-08-06 Thread Ken Fox
won't come again for a long time. > our mark routine should call Lisp's mark routine on those Lisp objects > we still reference, which would allow those we don't to be collected. In general it isn't going to be possible to integrate tightly with a foreign collector. Fo

Re: RFC: Foreign objects in perl

2000-08-06 Thread Dan Sugalski
| | | | > | car | cdr | > | | | > |-+-| > >If Perl uses reference-counting as its only garbage collection, this >loop will have to be broken explicitly. But if we anti

Re: RFC: Foreign objects in perl

2000-08-07 Thread Dan Sugalski
At 09:25 AM 8/6/00 -0400, Ken Fox wrote: >John Tobey wrote: > > But if we anticipate possibly implementing mark-and-sweep > >We're definitely going to have some sort of traversing collector. It >might only augment the ref count collector. I'd rather not have multiple GC schemes going at once. (Th

Re: RFC: Foreign objects in perl

2000-08-08 Thread Ken Fox
Dan Sugalski wrote: > At 09:25 AM 8/6/00 -0400, Ken Fox wrote: > > We're definitely going to have some sort of traversing collector. It > > might only augment the ref count collector. > > I'd rather not have multiple GC schemes going at once. (Though we may need > some sort of "refered to by" fie

Re: RFC: Foreign objects in perl

2000-08-09 Thread Dan Sugalski
At 10:36 PM 8/8/00 -0400, Ken Fox wrote: >Dan Sugalski wrote: > > At 09:25 AM 8/6/00 -0400, Ken Fox wrote: > > > We're definitely going to have some sort of traversing collector. It > > > might only augment the ref count collector. > > > > I'd rather not have multiple GC schemes going at once. (Th

Re: RFC: Foreign objects in perl

2000-08-12 Thread Larry Wall
e everyone happy. Whether or not strings appear to be objects in Perl, they will certainly need vtables in perl. Larry

Splitting core functions into multiple shared objects: A warning

2000-08-26 Thread Alan Burlison
Beware of dependencies between shared objects. Let's assume 2 chunks of core functionality are seperated off into say A.so and B.so. This will work fine as long as there are no interdependencies between A.so and B.so. Let's however assume A.so needs to call something in B.so.

Shared objects and handoffs (was Re: Parrot's threading model)

2001-10-22 Thread David M. Lloyd
is to be able to take groups of objects and pass them between threads (but not necessarily have them be shared) instead of having several individual mutex-protected objects. Maybe an extension on the compartments idea: Allow a parrot program to declare a new PMC container. Then when the prog

RFC 32 (v1) A method of allowing foreign objects in

2000-08-04 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://tmtowtdi.perl.org/rfc/ =head1 TITLE A method of allowing foreign objects in perl =head1 VERSION Maintainer: Dan Sugalski <[EMAIL PROTECTED]> Date: August 02, 2000 Version: 1 Mailing List: [EMAIL PROTECTED] Number: 32

RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-07 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Interfaces for linking C objects into perlsubs =head1 VERSION Maintainer: David Nicol <[EMAIL PROTECTED]> Date: 7 Aug 2000 Version: 2 Mailing List: [EMAIL PROTECTED] Number: 61 =head1 AB

Re: Splitting core functions into multiple shared objects: A warning

2000-08-28 Thread Grant M.
I think the importance of splitting the core functionality into shared objects is more general than that. There was some discussion a short time ago about making a pared-down version for embedding, which would seem to require some sort of functionality reduction. There is also the desire of

Re: RFC 32 (v1) A method of allowing foreign objects in

2000-08-04 Thread John Porter
> perl punts. We require that the code we interface to defines a > dispatch function for each object, and we then just call the dispatch > function with enough information for it to Do The Right Thing. > > Perl will define some generic conversion > routines (to int, float, and string) which the f

Re: RFC 32 (v1) A method of allowing foreign objects in

2000-08-04 Thread Dan Sugalski
At 05:33 PM 8/4/00 -0400, John Porter wrote: > > perl punts. We require that the code we interface to defines a > > dispatch function for each object, and we then just call the dispatch > > function with enough information for it to Do The Right Thing. > > > > Perl will define some generic convers

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-08 Thread Hildo Biersma
Perl6 RFC Librarian wrote: > > This and other RFCs are available on the web at > http://dev.perl.org/rfc/ > > =head1 TITLE > > Interfaces for linking C objects into perlsubs > > =head1 VERSION > > Maintainer: David Nicol <[EMAIL PROTECTED]> > D

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-08 Thread Dan Sugalski
At 01:04 AM 8/8/00 +, Perl6 RFC Librarian wrote: >=head1 TITLE > >Interfaces for linking C objects into perlsubs This sounds more like we want perl to act like C's prologue code, so we can invoke C programs without firing up a sub-process. It sounds rather nice, but gettin

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-08 Thread David L. Nicol
Hildo Biersma quoted RFC 62 and then went on thusly: > > C is an excellent medium for sharing the glory of the internals > > of Perl with the C programming community. It is hoped that the > > interface deescribed herein will become an excellent medium for > > sharing the glory of the internals o

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-08 Thread Nick Ing-Simmons
Perl6 Rfc Librarian <[EMAIL PROTECTED]> writes: >This and other RFCs are available on the web at > http://dev.perl.org/rfc/ > >=head1 TITLE > >Interfaces for linking C objects into perlsubs > >=head1 VERSION > > Maintainer: David Nicol <[EMAIL PROTEC

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-08 Thread Dan Sugalski
On Tue, 8 Aug 2000, Nick Ing-Simmons wrote: > Perl6 Rfc Librarian <[EMAIL PROTECTED]> writes: > >This document is not precisely concerned with the details of the > >implementation > >of the interfaces it specifies, beyond a general attempt to restric > >itself to the possible. > > But this list

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-09 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: >On Tue, 8 Aug 2000, Nick Ing-Simmons wrote: > >> Perl6 Rfc Librarian <[EMAIL PROTECTED]> writes: >> >This document is not precisely concerned with the details of the >> >implementation >> >of the interfaces it specifies, beyond a general attempt to restric

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-09 Thread David L. Nicol
#x27;t know about doing it all within the process we have already, but I can implement the interface (for C) by automating the creation of a short C program that can accept input in some form that I will provide to it, compiling it, linking it against the provided objects, and keeping around the re

Re: RFC 61 (v2) Interfaces for linking C objects into pe

2000-08-09 Thread Nick Ing-Simmons
nput in some form that I >will provide to it, compiling it, linking it against the provided >objects, and keeping around the result, as a standalone file in a >temporary file space available to this program, all the preceding >at compile time, and at run time marshalling the input dat