Re: Larry Wall, on Tcl



On Dec 14, 5:12 am, "Donal K. Fellows"
<donal.k.fell...@xxxxxxxxxxxxxxxx> wrote:
tom.rmadilo wrote:
But the idea that something must have a reference count that would
inform the need to garbage collect seems impossible in Tcl.

It's not impossible as it happens, since you can do tricks with the
reference counting in Tcl_Objs. It's not something that's strictly
within the language semantics (boo!) but it works pretty well anyway, as
users of Jacl, TclBlend and TCOM can attest. (It's not full-blown GC,
but that's actually not needed so often as there's not that much need to
do circular structure references in Tcl.)

Right, but Jacl, TclBlend and TCOM are Tcl applications. If you get to
the C level, where pointers exist you can do this, if you expose
pointers to the Tcl scripting level, I guess you could do it too, but
AFAIK, regular Tcl you can't lose a reference and not consider that a
bug, since there would be no way to remove it.

I wish someone would explain why the need to GC could be considered a
good thing if you use a language that strictly speaking cannot create
garbage.
.



Relevant Pages

  • Re: Larry Wall, on Tcl
    ... extensions written in something other than Tcl, ... I've been trying to identify a problem with using Tcl that garbage ... the only kind of reference ... TCL allows is a rather flimsy string token. ...
    (comp.lang.tcl)
  • Re: Is garbage collection here yet?
    ... clean up afterwards i.e. collecting the garbage. ... If you clean up afterwards, it's not leaking, right? ... Ok, to rephrase it, you let garbage accumulate. ... before the next line of tcl code gets excuted. ...
    (comp.lang.tcl)
  • Re: Larry Wall, on Tcl
    ... Tcl, that is, not only of the facilities that the language provides, ... employ a generic garbage collection for Tcl. ... If the parent goes away and doesn't clean up these ...
    (comp.lang.tcl)
  • Re: Larry Wall, on Tcl
    ... You do not understand the meaning of "garbage". ... Maybe what you are saying, and what I would agree with is that Tcl ... so who cares if I know what garbage is. ...
    (comp.lang.tcl)
  • Re: garbage collection / cyclic references
    ... garbage collector is painful. ... might/ already be in a reference cycle. ... should be strong pointers, while back-pointers towards the root should ... Reference cycles can be detected anyway with debug tools, ...
    (comp.lang.python)