Re: A re-announce on GC's defects

Tech-Archive recommends: Speed Up your PC by fixing your registry




Born wrote:
Object lifetime and resource lifetime are similar, so similar that other
languages (such as C++) put code managing them in the same place - the
destructor. However, GC is not a solution for both: it's a solution for
object lifetime *only*.

You've not responded to this point - it's the fundamental assumption on
which your argument falls flat.


Well, I don't care if they are two different things or not. I want to use
object lifetime to tell its weak references that it's gone.

I don't know nearly as much as Barry on this subject, but I immediately
note a semantic problem here: what do you mean by "gone"?

In C++ you have total control over that concept, and C++ software is
usually designed so that all definitions of "gone" occur simultaneously
in the object's destructor. However, this is an artifact of the
language, not a truism.

Let's take your game, for example. An object representing an adversary
can be killed, "gone" from the point of view of the player, but still
be on a queue somewhere waiting for some post-death processing, so not
yet "gone" from the point of view of the game software. In C#, the
object can have any resources it's holding released, but still have
references to it, in other words, Disposed, or "gone" from the point of
view of being any longer usable. Hopefully, a few nanoseconds after
that the last reference to the object goes out of scope, so now the
object is "gone" from the point of view of the program, but may still
be taking up memory. Then, finally, the GC reclaims it, so it is now
"gone" from all points of view.

So... what do you mean by "gone"?

.



Relevant Pages

  • Re: How come Ada isnt more popular?
    ... then But non contigous representation of arrays will really stress ... It's easy with value-oriented languages (i.e. languages ... use references because of that. ... The example you mentioned was a tree. ...
    (comp.lang.ada)
  • Re: How come Ada isnt more popular?
    ... The language does not require array implementation to be contiguous. ... then But non contigous representation of arrays will really stress ... It's easy with value-oriented languages (i.e. languages ... use references because of that. ...
    (comp.lang.ada)
  • Re: Is garbage collection here yet?
    ... frequently writes in other high-level languages. ... references are implicit, other times they're explicit, but one thing is ... nested data structures very easily. ... Tcl seems to have avoided adding something resembling references to the ...
    (comp.lang.tcl)
  • Re: OT:C/C++ Opinion Poll
    ... GC was to first remove the memory allocation/deallocation ... abstraction entirely in higher level languages. ... Removing references is what was meant. ... Even replacing all calls to free with a null pointer assignment ...
    (comp.arch.embedded)
  • Re: _Verum Et Factum Convertuntur_ (or: Surprised By Syntax)
    ... >>> You never seem to disagree with your authorities. ... > familiar facts", instead of writing down the facts directly, so we all ... Simple fact: languages use phonemes. ... > Why would anyone go to a newsgroup and look for references to books he ...
    (sci.lang)