> is there a pattern here that can be tapped into such that by monitoring
> a type of "scope" for an object, when that scope is completed all
> objects within it should be destroyed?

The issue of scope is different for Ruby than for a language like C/C++
because a variable is a reference to an object, not the object itself.
This means that objects travel around at runtime and behave in a fairly
scopeless way.  I suppose scope in this case ends when the object is no
longer referenced.  This is the problem, reference counting offers a
potential solution but is flawed because of cyclic references.

> p.s. if you really want speed for an embedded solution why do GC at all?
> just take the c/c++ approach.

A couple of reasons:

1. C/C++ needs to much language scaffolding and is too error prone for
situations where all you care about is modelling behaviour.
2. Dynamics.  I need to be able to change classes and variables, and use
reflection at runtime.

--
Justin Johnson