Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Reclaiming Allocated Memory Date: Mon, 25 Nov 2013 07:04:22 -0800 Organization: Nightsong/Fort GNOX Lines: 24 Message-ID: <7x1u24o749.fsf@ruckus.brouhaha.com> References: <5293458b$0$296$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="d94d289a4df6ae47ea4d4f8b2ae808e7"; logging-data="8142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OsX0ScYCHFRc+aNgYHVz7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:BBHDpx8CGaG+UZQBCRWSBjwlEuU= sha1:vXmlRklhbOECY0k+SkNHgRVfOBY= Xref: csiph.com comp.lang.forth:26942 Doug Hoffman writes: > ..., while it would be great to have garbage collection > (GC) the problems of having an acceptable Forth GC seem difficult or > not possible to solve. I think you mentioned trying this: http://www.complang.tuwien.ac.at/forth/garbage-collection.zip What are the main problems it faces? I haven't tried it myself, but it looks really nice, and the method it uses was originally implemented for C, where it has had some success. > By using a Forth object system with the above manual memory > reclamation scheme we can have, for example, an easy to use string > package that integrates well with the rest of Forth, I'm having trouble believing such a system can be easy to use, if the object references can be freely shared around the program. C++ has evolved towards dealing with this by explicitly invoked automatic reference counting (the STL shared_ptr template) and other languages do everything through pervasive refcounting (Python) or GC. I think Forth and C these days simply work best in applications where there's not much use of dynamically managed memory.