Re: Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
> With cons based lists, past stream values are no longer referred to > so can be reclaimed, but we have random access arrays. > > That's about where my wondering stopped. It started again. @primesquares.shift would do it Brad

Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
Hi, I've been wondering how to lazy lists will work. The answer "Correctly, don't worry about it", is entirely acceptable... The intent of this example in S06 seems clear, make @oddsquares a lazily filled array of squares of odd @nums: S06/Pipe operators It [==>] binds the (potentially lazy

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

2001-02-14 Thread Tony Olekshy
, but this an implicit end of lexical scope cleanup for $p (not an explicit finally clause or POST block), so if $p's object's refcount is 1, or it is found in some sort of sweep, then DESTROY and garbage collection can be considered. Meanwhile, I agree that try/finally (or any similar su

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: 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 abigail
call back from perl, the binary, that everyone is done with the object, and it's about to go away. DESTROY might be called around the same time its memory is being reclaimed, but from a language perspective, all this memory dealing is non-existant. DESTROY is a language thing, garbage collect

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

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

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: 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: End-of-scope actions: Garbage collection.

2001-02-13 Thread Dan Sugalski
At 03:56 PM 2/12/2001 -0700, Tony Olekshy wrote: >Dan Sugalski wrote: > > > > [...] I wasn't talking about try{}/finally{} stuff. I was talking > > about DESTROY (or its equivalent) for objects, which unfortunately > > can't be tied to any one particular place in the code. > >and, from another thr

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

2001-02-13 Thread Peter Scott
At 06:35 PM 2/13/01 +, Nicholas Clark wrote: > > This may be a naive question, but what is the benefit - aside from > > consistency, and we don't need to rehash the litany on that - to AUTOLOAD > > getting called for DESTROY? I've never actually seen any code that makes > > use of it. I hav

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

2001-02-13 Thread Dan Sugalski
At 10:32 AM 2/13/2001 -0800, Peter Scott wrote: >At 01:16 PM 2/13/01 -0500, James Mastros wrote: >>On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: >>Certainly AUTOLOAD gets >> > called if DESTROY is called but not defined ... just >> > like any other method. >>The idea is [for Larry]

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

2001-02-13 Thread Nicholas Clark
On Tue, Feb 13, 2001 at 10:32:26AM -0800, Peter Scott wrote: > At 01:16 PM 2/13/01 -0500, James Mastros wrote: > >On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > >Certainly AUTOLOAD gets > > > called if DESTROY is called but not defined ... just > > > like any other method. > >The i

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

2001-02-13 Thread Peter Scott
At 01:16 PM 2/13/01 -0500, James Mastros wrote: >On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: >Certainly AUTOLOAD gets > > called if DESTROY is called but not defined ... just > > like any other method. >The idea is [for Larry] to declare "no, it isn't". Otherwise, you have to >do

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

2001-02-13 Thread schwern
On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) > > I'm not sure what that means. Certainly AUTOLOAD gets > called if DESTROY is called but not defined ... just > like any other method. Yes, its a classic autoloader mistake

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

2001-02-13 Thread James Mastros
On Tue, Feb 13, 2001 at 01:09:11PM -0500, John Porter wrote: > > James Mastros wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) [Note: that's a hypothetical quote.] > I'm not sure what that means. Certainly AUTOLOAD gets > called if DESTROY is called but not defined ... just > l

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

2001-02-13 Thread John Porter
> James Mastros wrote: > > >"It isn't possible to AUTOLOAD DESTROY." --perlmem(6) I'm not sure what that means. Certainly AUTOLOAD gets called if DESTROY is called but not defined ... just like any other method. -- John Porter

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

2001-02-13 Thread Nicholas Clark
On Tue, Feb 13, 2001 at 12:40:45PM -0500, Dan Sugalski wrote: > At 05:55 PM 2/12/2001 -0500, James Mastros wrote: > >It's pretty hard (for me) to think of when you'd want an AUTOLOADed DESTROY, > >since if you create /any/ objects of the class, DESTROY will be called. > >"It isn't possible to AUT

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

2001-02-13 Thread Dan Sugalski
At 05:55 PM 2/12/2001 -0500, James Mastros wrote: >On Mon, Feb 12, 2001 at 05:33:05PM -0500, Dan Sugalski wrote: > >package foo; > >use attrs qw(cleanup_sub); > > > > would be nice, but I don't know that he'll go for it. (Though it's the > only > > way I can think of to avoid AUTOLOAD bei

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

2001-02-12 Thread James Mastros
On Mon, Feb 12, 2001 at 05:33:05PM -0500, Dan Sugalski wrote: >package foo; >use attrs qw(cleanup_sub); > > would be nice, but I don't know that he'll go for it. (Though it's the only > way I can think of to avoid AUTOLOAD being considered a potential destructor) Fiat? It's pretty hard

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

2001-02-12 Thread Tony Olekshy
on has some eval-like semantics. Therefore, a complete consideration of the matter of end-of-scope includes not just (1) garbage collection, and (2) DESTROY, but also (3) the matter of end-of-scope operations explicitly requested by the developer, in an explicit order which may or may not be related

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

2001-02-12 Thread Robin Berjon
At 17:33 12/02/2001 -0500, Dan Sugalski wrote: >At 11:28 PM 2/12/2001 +0100, Robin Berjon wrote: >>Couldn't we simply (for non-implementer values of simply) provide a way for >>people to ask for finalization on an object ? Given that most of the time >>it isn't needed, it wouldn't be too much of a

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

2001-02-12 Thread Dan Sugalski
At 11:28 PM 2/12/2001 +0100, Robin Berjon wrote: >At 15:37 12/02/2001 -0500, Dan Sugalski wrote: > >It *is* rare in OO perl, though. How many of the variables you use are > >really, truly in need of finalization? .1 percent? .01 percent? Less? Don't > >forget that you need to count every scalar in

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

2001-02-12 Thread Robin Berjon
At 15:37 12/02/2001 -0500, Dan Sugalski wrote: >It *is* rare in OO perl, though. How many of the variables you use are >really, truly in need of finalization? .1 percent? .01 percent? Less? Don't >forget that you need to count every scalar in every array or hash, and >every iteration over a blo

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

2001-02-12 Thread Dan Sugalski
At 01:44 PM 2/12/2001 -0800, Jan Dubois wrote: >On Mon, 12 Feb 2001 16:28:00 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: > > >Yep, that's another issue, and one I keep forgetting about, though the fact > >that we don't do predictable finalization on some objects isn't a good > >Yes, I know I pr

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

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 16:28:00 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: >Yep, that's another issue, and one I keep forgetting about, though the fact >that we don't do predictable finalization on some objects isn't a good Yes, I know I promised to shut up until you come up with a spec, but

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

2001-02-12 Thread Dan Sugalski
At 09:08 PM 2/12/2001 +, Piers Cawley wrote: >Dan Sugalski <[EMAIL PROTECTED]> writes: > > > At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: > > >On Mon, 12 Feb 2001, Dan Sugalski wrote: > > > > > > > Perl needs some level of tracking for objects with finalization > attached to > > > > them. F

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

2001-02-12 Thread Dan Sugalski
At 01:59 PM 2/12/2001 -0700, Tony Olekshy wrote: >Dan Sugalski wrote: > > > > I do wish people would get garbage collection and finalization split in > > their minds. They are two separate things which can, and will, be dealt > > with separately. > > > &

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

2001-02-12 Thread Piers Cawley
Dan Sugalski <[EMAIL PROTECTED]> writes: > At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: > >On Mon, 12 Feb 2001, Dan Sugalski wrote: > > > > > Perl needs some level of tracking for objects with finalization attached to > > > them. Full refcounting isn't required, however. > > > >I think I've hea

End-of-scope actions: Garbage collection.

2001-02-12 Thread Tony Olekshy
Dan Sugalski wrote: > > I do wish people would get garbage collection and finalization split in > their minds. They are two separate things which can, and will, be dealt > with separately. > > For the record: > > THE GARBAGE COLLECTOR WILL HAVE NOTHING TO DO WITH FIN

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

2001-02-12 Thread Dan Sugalski
At 01:33 PM 2/12/2001 -0500, Sam Tregar wrote: >On Mon, 12 Feb 2001, Dan Sugalski wrote: > > > >I think I've heard you state that before. Can you be more specific? What > > >alternate system do you have in mind? Is this just wishful thinking? > > > > This isn't just wishful thinking, no. > >You

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

2001-02-12 Thread Dan Sugalski
At 10:46 AM 2/12/2001 -0800, Jan Dubois wrote: >On Mon, 12 Feb 2001 13:29:21 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: > > >At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: > >>On Mon, 12 Feb 2001, Dan Sugalski wrote: > >> > >> > Perl needs some level of tracking for objects with finalization

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

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 13:33:52 -0500 (EST), Sam Tregar <[EMAIL PROTECTED]> wrote: >> It's reasonably obvious (which is to say "cheap") which variables aren't >> involved with anything finalizable. > >Probably a simple bit check and branch. Is that cheap? I guess it must >be. Yes, but incrementin

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

2001-02-12 Thread Nicholas Clark
On Mon, Feb 12, 2001 at 01:33:52PM -0500, Sam Tregar wrote: > Perhaps. It's not rare in OO Perl which is coincidentally one area in > serious need of a speedup. I suppose I'm warped by my own experience - > all the code I see every day is filled with references and objects. > That's probably not

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

2001-02-12 Thread Jan Dubois
On Mon, 12 Feb 2001 13:29:21 -0500, Dan Sugalski <[EMAIL PROTECTED]> wrote: >At 10:38 AM 2/12/2001 -0500, Sam Tregar wrote: >>On Mon, 12 Feb 2001, Dan Sugalski wrote: >> >> > Perl needs some level of tracking for objects with finalization attached to >> > them. Full refcounting isn't required, ho

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

2001-02-12 Thread Sam Tregar
On Mon, 12 Feb 2001, Dan Sugalski wrote: > >I think I've heard you state that before. Can you be more specific? What > >alternate system do you have in mind? Is this just wishful thinking? > > This isn't just wishful thinking, no. You picked the easy one. Maybe you can get back to the other

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

2001-02-12 Thread Dan Sugalski
ch is to say "cheap") which variables aren't involved with anything finalizable. > > I do wish people would get garbage collection and finalization split in > > their minds. They are two separate things which can, and will, be dealt > > with separately. > >2x

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

2001-02-12 Thread Branden
Sam Tregar wrote: > On Mon, 12 Feb 2001, Dan Sugalski wrote: > > Also, the vast majority of perl variables have no finalization > > attached to them. > > That's true, but without static typing don't you have to treat them as if > they did? At the very least you need to do a "is it an object with

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

2001-02-12 Thread Sam Tregar
t; check at block boundaries. > I do wish people would get garbage collection and finalization split in > their minds. They are two separate things which can, and will, be dealt > with separately. 2x the penalty, right? Instead of a speed increase we carry the burden of ref-counting in addition to the overhead of an alternate system. -sam

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

2001-02-11 Thread Dan Sugalski
. Also, the vast majority of perl variables have no finalization attached to them. I do wish people would get garbage collection and finalization split in their minds. They are two separate things which can, and will, be dealt with separately. For the record: THE GARBAGE COLLECTOR WILL HAVE

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

2001-02-11 Thread Sam Tregar
On Sun, 11 Feb 2001, Jan Dubois wrote: > However, I couldn't solve the problem of "deterministic destruction > behavior": Currently Perl will call DESTROY on any object as soon as the > last reference to it goes out of scope. This becomes important if the > object own scarce external resources (

Re: Garbage collection

2001-02-11 Thread Bryan C . Warnock
wouldn't you still want Perl to panic, vice the XS code anyway? > > This scheme would only work if *all* resources including memory and > garbage collection are handled by the OS (or at least by a virtual machine > like JVM or .NET runtime). But this still doesn't solve

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

2001-02-11 Thread Jan Dubois
ate time in the future can lead to program failures due to >> resource exhaustion. > >But doesn't resource exhaustion usually trigger garbage collection and >resource reallocation? (Not that this addresses the remainder of your >post.) Not necessarily; you would have to

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

2001-02-11 Thread Bryan C . Warnock
the > object own scarce external resources (e.g. file handles or database > connections) that are only freed during DESTROY. Postponing DESTROY until > an indeterminate time in the future can lead to program failures due to > resource exhaustion. But doesn't resource exhaustion usually

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

2001-02-11 Thread Jan Dubois
o be large. Plus the code to >do the GC work is very localized, which tends not to be the case in >refcounting schemes. > >Going to a more advanced garbage collection scheme certainly isn't a >universal panacea--mark and sweep in perl 6 will *not* bring about world >peac

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

2001-02-09 Thread Dan Sugalski
ry management up/down by 100% might not even be noticeable. I was thinking of things that may process a lot of data but in small pieces, like the command-line greps and suchlike things. They can take a while on 100M files, but that shouldn't be because they've eaten 200M of RAM in the pr

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

2001-02-09 Thread Ken Fox
u'll have less overhead). Reuse is generally faster and less > resource-intensive than recycling. What's true for tin cans is true for memory. The electrons are re-used whether you allocate a new object or not... ;) > Going to a more advanced garbage collection scheme certainly isn't

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

2001-02-09 Thread Dan Sugalski
At 06:30 PM 2/9/2001 +, Nicholas Clark wrote: >On Fri, Feb 09, 2001 at 01:19:36PM -0500, Dan Sugalski wrote: > > The less memory you chew through the faster your code will probably be (or > > at least you'll have less overhead). Reuse is generally faster and less > > resource-intensive than re

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

2001-02-09 Thread Nicholas Clark
On Fri, Feb 09, 2001 at 01:19:36PM -0500, Dan Sugalski wrote: > The less memory you chew through the faster your code will probably be (or > at least you'll have less overhead). Reuse is generally faster and less > resource-intensive than recycling. What's true for tin cans is true for memory.

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

2001-02-09 Thread Dan Sugalski
... But I actually think this is because Perl 5's >implementation of refcounting is quite messy, specially when weakrefs are in >the game. Almost all refcounting schemes are messy. That's one of its problems. A mark and sweep GC system tends to be less prone to leaks because of pr

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

2001-02-09 Thread Branden
Dan Sugalski wrote: > At 12:06 PM 2/9/2001 -0500, Ken Fox wrote: > > 2. Work proportional to live data, not total data. This is hard to > > believe for a C programmer, but good garbage collectors don't have > > to "free" every allocation -- they just have to preserve the live, > > or

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

2001-02-09 Thread Dan Sugalski
At 12:06 PM 2/9/2001 -0500, Ken Fox wrote: >Branden wrote: > > I actually don't understand how traversing a graph can be faster than > > incrementing/decrementing/testing for zero on a refcount. > >There are two main reasons advanced garbage collectors are fast: > > 1. Cheap allocations. Most fas