Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Communication between different C extensions

Thread Tools

Communication between different C extensions

Vincent Fourmond
Posts: n/a

Hello !

A long time ago, I was bitten hard by interoperability between
different C extensions that need to access each others internals. As at
that moment I was controlling the source code of all extensions, I got
away with a (simple ?) workaround.

Now is time for me to get bitten again. I'm currently writing a Ruby
wrapper for a C++ library providing simple symbolic calculus (and
evaluation). The extensions provides functions to apply a formula to a
great number of numbers, a bit like the following:

apply("x + y", 'x' => [1,2], 'y' => [3,4])
=> [4,6]

I want to be able to interface that with the common libraries for
manipulating data (Narray, ruby-gsl and Dobjects, a library used by
Tioga). However, I'm not aware of any way to do this 'cleanly'. Sure, I
can hack the data structures from the headers of these extensions, but
that means breaking binary compatibility everytime a header changes -
not very much something I like.

Is there a better way to do so ? Going through Ruby arrays isn't an
option for speed issues (very expensive to convert a double * to a VALUE
array and back to double *...). Any ideas ?



Vincent Fourmond, PhD student (not for long anymore)

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Communication between to different subnets using one DHCP server. Joed MCSE 3 12-15-2008 04:06 PM
communication between two classes which in different threading Marco Python 0 04-06-2007 02:05 AM
Create single application run on different devices communication with different interface nishadixit Java 0 05-24-2005 10:23 AM
inter-communication between modules in different slot.?? Cisco 5 05-23-2005 05:42 PM
Communication between Java applications running on different JVMs Java 1 01-05-2005 12:25 PM