Re: RFC on Coexistance and simulaneous use of multiple module version s?

2001-02-14 Thread Steve Simmons
On Fri, Jan 26, 2001 at 02:08:01PM -0600, Garrett Goebel wrote: > Discussion of RFC 271 and 194 on pre and post handlers for subroutines > reminded me of Larry's desire for Perl 6 to support the coexistence of > different versions of modules. > > Besides http://dev.perl.org/rfc/78.pod, are there

Re: End-of-scope actions: Toward a hybrid approach.

2001-02-14 Thread James Mastros
On Wed, Feb 14, 2001 at 07:40:26PM -0700, Tony Olekshy wrote: > The problem may be that a dynamic always statement means both > "no matter what happens" and "not until later". The static > finally clause just means "no matter what happened" (the effect > is immediate). I'm fond of post, myself.

Re: End-of-scope actions: Toward a hybrid approach.

2001-02-14 Thread Tony Olekshy
Glenn Linderman wrote: > > Tony Olekshy wrote: > > > > If we take this approach then we know exactly what the following > > code will do. > > > > { my $p = P->new(); > > > > $p->foo and always { $p->bar }; > > > > except Error::IO { $p->baz }; > > } > > > > We also know when

Re: End-of-scope actions: do/eval duality.

2001-02-14 Thread Tony Olekshy
Glenn Linderman wrote: > > Tony Olekshy wrote: > > > Traditionally Perl has had both the "do" and the "eval" block > > forms, the latter which traps, the former which doesn't. > > In the perl 5 pocket reference 3rd edition page 63, it claims that > $@ is set to the result of an eval or do. How

Re: End-of-scope actions: Toward a hybrid approach.

2001-02-14 Thread Tony Olekshy
"David L. Nicol" wrote: > > Tony Olekshy wrote: > > > If we take this approach then when you just want to casually say > > > > my $f = open $file; always { close $f }; > > > > you can. I like that. In addition, [...] > > How about "later" instead of "always" > > Because: "later" is a time in

End-of-scope actions: Core exceptions.

2001-02-14 Thread Tony Olekshy
Nicholas Clark wrote: > > my $f = open $file or die "can't open $file"; > > is troublesome. It doesn't report *why* the file can't be opened. > > [...] *flexible* exceptions are needed The first version of RFC 88 didn't care what exception objects were, but discussions in the errors mailing lis

Re: End-of-scope actions: Background.

2001-02-14 Thread Tony Olekshy
Peter Scott wrote: > > > try { > > die "foo"; > > } catch { > > die "bar"; > > } > > > > [...] > > Surely the first one catches it cleanly since it has a > "catch-all" catch clause. That "catch-all" clause throws. In RFC 88 we said, in the Definitions section,

Re: End-of-scope actions: Garbage collection.

2001-02-14 Thread Tony Olekshy
Dan Sugalski wrote: > > Tony Olekshy wrote: > > > >I think we need to provide some way for developers to explicitly > >specify predictable end-of-block cleanup (using something like an > >always block or finally clause). > > Attributes or other things stuck on the end of blocks strikes me as > a

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Hong Zhang
> A deterministic finalization means we shouldn't need to force programmers > to have good ideas. Make it easy, remember? :) I don't believe such an algorithm exists, unless you stick with reference count. Hong

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Damien Neil
On Thu, Feb 15, 2001 at 12:11:27AM +, Simon Cozens wrote: > > Using object lifetime to control state is almost never a good idea, > > even if you have deterministic finalization. > > A deterministic finalization means we shouldn't need to force programmers > to have good ideas. Make it easy,

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 01:24:34PM -0800, Damien Neil wrote: > Using object lifetime to control state is almost never a good idea, > even if you have deterministic finalization. A deterministic finalization means we shouldn't need to force programmers to have good ideas. Make it easy, remember?

Resource Management ?

2001-02-14 Thread Elizabeth Mattijsen
After lurking on the Perl6-lists and finally catching up on this long discussion about garbage collection, I'm coming out ;-). The reason I'm coming out is that I realised that we should maybe have a radically different view on garbage collection than we have now. Think about it: 1: in an ide

Re: Please shoot down this GC idea...

2001-02-14 Thread Hong Zhang
I want to share my experience of garbage collection of the Java virtual machine. There are two common types of garbage collection, the agressive reference count based and everything else. The reference count system can garantee the quick response to memory release. In such a system, we can safel

Re: Please shoot down this GC idea...

2001-02-14 Thread Graham Barr
On Wed, Feb 14, 2001 at 03:38:55PM -0500, Dan Sugalski wrote: > At 08:29 PM 2/14/2001 +, Graham Barr wrote: > >On Wed, Feb 14, 2001 at 03:04:40PM -0500, Dan Sugalski wrote: > > > At 05:57 PM 2/14/2001 -0300, Branden wrote: > > > >Simon Cozens wrote: > > > > > On Wed, Feb 14, 2001 at 11:38:58AM

Re: Please shoot down this GC idea...

2001-02-14 Thread Graham Barr
On Wed, Feb 14, 2001 at 03:04:40PM -0500, Dan Sugalski wrote: > At 05:57 PM 2/14/2001 -0300, Branden wrote: > >Simon Cozens wrote: > > > On Wed, Feb 14, 2001 at 11:38:58AM -0800, Damien Neil wrote: > > > > sub do_stuff { ... } > > > > > > > > { > > > > my $fh = IO::File->new("file"); > > >

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Damien Neil
On Wed, Feb 14, 2001 at 05:43:31PM -0300, Branden wrote: > 4. Why should we bother destroying an object before GC does it? > > To free system resources, like open files or database connections. Probably > the average program won't do it never, but programs that must open several > files sequentia

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Damien Neil
[trimming distribution to -internals only] On Wed, Feb 14, 2001 at 07:44:53PM +, Simon Cozens wrote: > package NuclearReactor::CoolingRod; > > sub new { > Reactor->decrease_core_temperature(); > bless {}, shift > } > > sub DESTROY { > Reactor->increase_core_temperature(); > } A

Re: Please shoot down this GC idea...

2001-02-14 Thread Dan Sugalski
At 08:59 PM 2/14/2001 +, Graham Barr wrote: >On Wed, Feb 14, 2001 at 03:38:55PM -0500, Dan Sugalski wrote: > > At 08:29 PM 2/14/2001 +, Graham Barr wrote: > > >On Wed, Feb 14, 2001 at 03:04:40PM -0500, Dan Sugalski wrote: > > > > At 05:57 PM 2/14/2001 -0300, Branden wrote: > > > > >Simon C

Re: Please shoot down this GC idea...

2001-02-14 Thread Damien Neil
On Wed, Feb 14, 2001 at 03:04:40PM -0500, Dan Sugalski wrote: > Yes it can tell, actually--we do have the full bytecode to the sub > available to us, along with whatever metainfo we choose to remember > generally about the sub. Whether we use the info is a separate matter, of > course. What ab

Re: Please shoot down this GC idea...

2001-02-14 Thread Dan Sugalski
At 08:29 PM 2/14/2001 +, Graham Barr wrote: >On Wed, Feb 14, 2001 at 03:04:40PM -0500, Dan Sugalski wrote: > > At 05:57 PM 2/14/2001 -0300, Branden wrote: > > >Simon Cozens wrote: > > > > On Wed, Feb 14, 2001 at 11:38:58AM -0800, Damien Neil wrote: > > > > > sub do_stuff { ... } > > > > > >

Re: Please shoot down this GC idea...

2001-02-14 Thread Dan Sugalski
At 05:57 PM 2/14/2001 -0300, Branden wrote: >Simon Cozens wrote: > > On Wed, Feb 14, 2001 at 11:38:58AM -0800, Damien Neil wrote: > > > sub do_stuff { ... } > > > > > > { > > > my $fh = IO::File->new("file"); > > > do_stuff($fh); > > > } > > > > > > In this code, the compiler can det

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Dan Sugalski
At 07:44 PM 2/14/2001 +, Simon Cozens wrote: >On Wed, Feb 14, 2001 at 08:32:41PM +0100, [EMAIL PROTECTED] wrote: > > > DESTROY would get called twice, which is VERY BAD. > > > > *blink* > > It is? Why? > > I grant you it isn't the clearest way of programming, but "VERY BAD"? > >package Nuclear

Re: Please shoot down this GC idea...

2001-02-14 Thread Branden
Simon Cozens wrote: > On Wed, Feb 14, 2001 at 11:38:58AM -0800, Damien Neil wrote: > > sub do_stuff { ... } > > > > { > > my $fh = IO::File->new("file"); > > do_stuff($fh); > > } > > > > In this code, the compiler can determine that $fh has no active > > references at the end of the

Re: Please shoot down this GC idea...

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 11:38:58AM -0800, Damien Neil wrote: > sub do_stuff { ... } > > { > my $fh = IO::File->new("file"); > do_stuff($fh); > } > > In this code, the compiler can determine that $fh has no active > references at the end of the block No, it can't, but it can certai

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 08:32:41PM +0100, [EMAIL PROTECTED] wrote: > > DESTROY would get called twice, which is VERY BAD. > > *blink* > It is? Why? > I grant you it isn't the clearest way of programming, but "VERY BAD"? package NuclearReactor::CoolingRod; sub new { Reactor->decrease_core_te

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
[[ reply goes to -internals ]] OK. Let's clear it up all at once from start. Below is the lifecycle of an object (in Perl). A reference is blessed, and an object is the result of this blessing. During the object's life, several methods of it are called, but independent of which are called, it co

Re: Please shoot down this GC idea...

2001-02-14 Thread Damien Neil
On Wed, Feb 14, 2001 at 11:26:00AM -0500, Dan Sugalski wrote: > At 11:03 AM 2/14/2001 -0500, Buddha Buck wrote: > [Truly profound amount of snippage] > >I'm sure this idea has flaws. But it's an idea. Tell me what I'm missing. > > You've pretty much summed up the current plan. I have a strong

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread abigail
On Wed, Feb 14, 2001 at 02:10:59PM -0300, Branden wrote: > > Dan Sugalski wrote: > > > Plus there's nothing stopping you from having $obj->DESTROY in your own > > code, though it may be inadvisable. > > It is (mainly) inadvisable because: > 1. GC will call DESTROY when it collects the memory, s

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread abigail
On Wed, Feb 14, 2001 at 01:30:03PM -0300, Branden wrote: > John Porter wrote: > > James Mastros wrote: > > > I'd think that an extension to delete is in order here. Basicly, delete > > > should DESTROY the arg, change it's value to undef,... > > > > Huh? What delete are you thinking of? This is

Re: PDD 2, vtables

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 06:37:18PM +, David Mitchell wrote: > Hmm, there doesnt seem to be anything related to handling constants in PDD 2. I anticipate constants will be PMCs with a small vtable of "get methods", possibly with several different types of value (string, numberic, float, etc.)

Re: PDD 2, vtables

2001-02-14 Thread David Mitchell
After a week's delay where I've just been too busy, I thought I'd resurrect the corpse of a thread I was involved in. First off, on Wed, 07 Feb 2001 14:37:33, Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 07:05 PM 2/7/2001 +, David Mitchell wrote: > >Dan, before I followup your reply to m

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread John Porter
Branden wrote: > John Porter wrote: > > > ...and trigger a GC that will get rid of the arg. > > > > No. Perl decides for itself when to do GC. > > The idea is to *allow* a programmer to explicitly destroy an object, for > better (and sooner) resource disposal. The programmer wouldn't have to do

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread James Mastros
On Wed, Feb 14, 2001 at 01:25:26PM -0300, Branden wrote: > The problem is when objects are shared by > many variables. For example: > > $a = new Object(); > $b = $a; > ... > destroy $a; ## would call $a->DESTROY() > ... > $b->doSomething();## should die. Note

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread James Mastros
On Wed, Feb 14, 2001 at 01:43:22PM -0300, Branden wrote: > As I wrote in the last post, this isn't what I'm talking about. I'm talking > about destroying the object before the GC does. Yah, so am I. I'm just saying that after the object is destroyed, don't keep it around. > Yeah, what about a na

Re: Please shoot down this GC idea...

2001-02-14 Thread Dan Sugalski
At 11:03 AM 2/14/2001 -0500, Buddha Buck wrote: [Truly profound amount of snippage] >I'm sure this idea has flaws. But it's an idea. Tell me what I'm missing. You've pretty much summed up the current plan. Dan --"it's

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
[[ reply to this goes only to -internals ]] Dan Sugalski wrote: > *) People like it Well, if people liking it is the only reason (either is the only on or appears 3 times in a 5 item list, what is pretty much the same to me ;-) [... the only reason] to add a feature to Perl, we'll probably end

Please shoot down this GC idea...

2001-02-14 Thread Buddha Buck
Why won't this work: As I see it, we can't guarantee that DESTROYable objects will be DESTROYed immediately when they become garbage without a full ref-counting scheme. A full ref-counting scheme is potentially expensive. Even full ref-counting schemes can't guarantee proper and timely destr

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
David Mitchell wrote: > James Mastros <[EMAIL PROTECTED]> wrote: > > [snip about DESTORY predictablity not being neccessary] > > You're probably right about that, Branden. Quite nice, but not neccessary. > Hmm, I'd have to say that predictability is very, *very* nice, > and we shouldnt ditch it u

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
James Mastros wrote: > On Wed, Feb 14, 2001 at 09:59:31AM -0500, John Porter wrote: > > Huh? What delete are you thinking of? This is Perl, not C++. > Umm, perldoc -f delete? > > Come to think of it, this doesn't mesh purticularly well with the current > meaning of delete. It does, however, wit

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Dan Sugalski
At 10:12 AM 2/14/2001 -0300, Branden wrote: >David Mitchell wrote: > > James Mastros <[EMAIL PROTECTED]> wrote: > > > ... do refcounting (or somthing like it) for DESTROY to get called at >the right > > > time if the class (or any superclass) has an AUTOLOAD, which is >expensive. > > ... the above

Garbage collecting--can we hold off for a bit, please?

2001-02-14 Thread Dan Sugalski
Folks, I would really appreciate it if we could all hold off on discussions of garbage collecting for a little bit. We're all getting sloppy with terminology, and fuzzy with what does what and when. I should have a first cut of the garbage collection and object cleanup PDD by the end of the we

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
John Porter wrote: > James Mastros wrote: > > I'd think that an extension to delete is in order here. Basicly, delete > > should DESTROY the arg, change it's value to undef,... > > Huh? What delete are you thinking of? This is Perl, not C++. > Agreed, definitely Perl is not C++. > > ...and t

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
James Mastros wrote: > On Wed, Feb 14, 2001 at 10:12:36AM -0300, Branden wrote: > > Also, I think it would be valid for the programmer to explicitly say ``I > > would like to DESTROY this object now'', > I'd think that an extension to delete is in order here. Basicly, delete > should DESTROY the

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread David Mitchell
James Mastros <[EMAIL PROTECTED]> wrote: > [snip about DESTORY predictablity not being neccessary] > You're probably right about that, Branden. Quite nice, but not neccessary. Hmm, I'd have to say that predictability is very, *very* nice, and we shouldnt ditch it unless we *really* have to. [ l

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread James Mastros
On Wed, Feb 14, 2001 at 09:59:31AM -0500, John Porter wrote: > James Mastros wrote: > > I'd think that an extension to delete is in order here. Basicly, delete > > should DESTROY the arg, change it's value to undef,... > Huh? What delete are you thinking of? This is Perl, not C++. Umm, perldoc

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread John Porter
James Mastros wrote: > I'd think that an extension to delete is in order here. Basicly, delete > should DESTROY the arg, change it's value to undef,... Huh? What delete are you thinking of? This is Perl, not C++. > ...and trigger a GC that will get rid of the arg. No. Perl decides for itse

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread James Mastros
On Wed, Feb 14, 2001 at 10:12:36AM -0300, Branden wrote: > David Mitchell wrote: > > ... the above seems to imply a discussion that you only need to do > expensive > > ref-counting (or whatever) on objects which have a DESTROY method. > > However, since you dont know in advance what class(es), if

Re: "Art Of Unix Programming" on Perl

2001-02-14 Thread Simon Cozens
On Wed, Feb 14, 2001 at 02:52:35AM -0800, Ask Bjoern Hansen wrote: > I made a simple list of what we have so far at > http://dev.perl.org/ppd/ Magic! Thanks very much! (And for all the rest of the perl.org work, natch... :) -- "It is easier to fight for principles than to live up to them." --

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread Branden
David Mitchell wrote: > James Mastros <[EMAIL PROTECTED]> wrote: > > ... do refcounting (or somthing like it) for DESTROY to get called at the right > > time if the class (or any superclass) has an AUTOLOAD, which is expensive. > ... the above seems to imply a discussion that you only need to do e

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

2001-02-14 Thread David Mitchell
James Mastros <[EMAIL PROTECTED]> wrote: > The idea is [for Larry] to declare "no, it isn't". Otherwise, you have to > do refcounting (or somthing like it) for DESTROY to get called at the right > time if the class (or any superclass) has an AUTOLOAD, which is expensive. I'm coming in halfway th

Re: "Art Of Unix Programming" on Perl

2001-02-14 Thread Ask Bjoern Hansen
On Sun, 11 Feb 2001, Simon Cozens wrote: > Ask, could we have the PDDs placed up on dev.perl.org in the > same way as the RFCs, please? I made a simple list of what we have so far at http://dev.perl.org/ppd/ - ask -- ask bjoern hansen - http://ask.netcetera.dk/

Re: This week on the perl6 mailing lists

2001-02-14 Thread Ask Bjoern Hansen
On Wed, 14 Feb 2001, Simon Cozens wrote: [...] > If you think it would be ethical and correct for the assistants to draw > a salary while the editor does not, please go ahead and push O'Reilly > for money. I want a cent per mail delivered from the perl mailinglists![1] Who want's to pay? (In o

Re: Perl-QA needs administrative help

2001-02-14 Thread Ask Bjoern Hansen
On Tue, 13 Feb 2001 [EMAIL PROTECTED] wrote: > - Mailing list organization (creating new lists when necessary, etc..) I'm always happy to take care of that. Just mail me at [EMAIL PROTECTED], or better at [EMAIL PROTECTED] if you manage to remember that address. Experience shows that the ma