On Thu, Jun 4, 2015 at 8:08 AM, Nick Wellnhofer <[email protected]> wrote:
> On 04/06/2015 16:37, Marvin Humphrey wrote:

>> I'm hoping that we can implement Clownfish under Ruby such that...
>>
>> *   Clownfish objects *are* Ruby objects.
>> *   The Clownfish refcounting routines are made no-ops.
>> *   A `Visit_Refs` method can be factored out of our current `Destroy`
>>     methods which will be used for decref'ing under refcounting hosts and
>>     for the "mark" phase of mark-and-sweep GC under Ruby (and Python).
>
> You mean using a struct RObject as CFISH_OBJ_HEAD similar to what we plan
> for the Python bindings? Whether this works depends on how Ruby allocates
> and deallocates memory but I wouldn't be surprised if it turns out to be
> infeasible.

Yep, that's the case. :(  That's frustrating -- having to allocate a new Ruby
object wrapper every time that Clownfish sends an object into Ruby space
annoys me.  Since Ruby's GC actually watches the C stack, it would have been
an opportunity to demonstrate that Clownfish was flexible enough to work
within both a refcounting model and a tracing GC model while keeping the
object lifetimes coordinated.

> Also, this is only useful for subclassing Clownfish classes from the host
> language. If we have some kind of interface support, we'll probably want to
> remove this ability anyway. It doesn't make sense to have core features that
> are only supported by a subset of host languages.

This is what you described in the thread "Interface-based callbacks for Perl
bindings", right?

    http://markmail.org/message/nauw3psvuta7myn4

I guess I'm stuck in my old mental model and haven't quite grokked all the
details.

Marvin Humphrey

Reply via email to