From: Dan Sugalski Date: 2002-07-04T04:00:44+09:00 Subject: Re: Ruby implementation Q's At 3:54 AM +0900 7/4/02, Justin Johnson wrote: > > Well, how do other languages implement GC? Which language, in your >opinion, >> has the *best* form of garbage collection? I only know a little bit about >> GC, and then only with regards to Perl and Ruby. I have no idea how C, >C++, >> Java, Smalltalk, OCaml, Lisp, etc handle GC behind the scenes. > >Perl and Python use reference counting in combination with a mark-and-sweep >to reclaim cyclic reference garbage. C and C++ have only manual >allocation/destruction by default but libraries are available to provide >various flavours of garbage collection. This isn't true for perl. Perl uses a pure refcount scheme, with a walk of the arenas at the end of a program for forced destruction. No mark and sweep. (Python's got a more complex scheme which is generating some interesting discussion on the python-dev list at the moment, but I'm unfamiliar enough with it to say anything definitive) -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk