[redland-dev] ruby bindings

John Fieber jfieber at adobe.com
Mon Mar 10 23:05:44 GMT 2008


I'm curious if anyone here uses the Ruby bindings for Redland.

I ask because they appear to be broken in a serious way that would  
have been fixed by now if there were actually any users.

The Ruby classes built on top of the SWIG bindings handle freeing the  
underlying C structures by hooking up finalizers to call the  
librdf_free_foo() functions, apparently with the (invalid) assumption  
that a finalizer is semantically the same things as a destructor,  
which is not the case.  When using the C API, the order you call the  
free functions is important.  The calling order of finalizers in Ruby  
is non-deterministic, creating all manner of problems that change  
their expressions at the whim of the garbage collector.

In the short term, I've ditched the Ruby classes and am using the SWIG  
interface directly.  If I can find the time, I may be able to either  
fix or re-write the classes because they certainly would be useful.   
I'd be interested if anyone else has a take on this.

-john



More information about the redland-dev mailing list