Bindings/wrapper: how to?

Any tips or resources for creating a wrapper or bindings in Ruby to an existing C library?
How does one go about this correctly?

John Joyce wrote:

Any tips or resources for creating a wrapper or bindings in Ruby to an existing C library?
How does one go about this correctly?

http://www.swig.org/ is pretty widely used.

···

--
        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

The pickaxe has an excellent chapter on how to proceed with a simple library:

http://www.rubycentral.com/pickaxe/ext_ruby.html

Alex Gutteridge

Bioinformatics Center
Kyoto University

···

On 1 Oct 2007, at 12:28, John Joyce wrote:

Any tips or resources for creating a wrapper or bindings in Ruby to an existing C library?
How does one go about this correctly?

SWIG may be the way to go.
I'm learning Allegro at the moment and thinking how much less work it would be to type it in Ruby...
I've seen some people have done some Perl SWIGging with Allegro.
But I've got a bit too much going on to learn SWIG at the moment. I just want to find out what I may be facing.

John Joyce wrote:

SWIG may be the way to go.
I'm learning Allegro at the moment and thinking how much less work it would be to type it in Ruby...
I've seen some people have done some Perl SWIGging with Allegro.
But I've got a bit too much going on to learn SWIG at the moment. I just want to find out what I may be facing.

The Pickaxe has an excellent chapter on extending Ruby, or you can read the README.EXT that comes with the Ruby source files.

···

--
RMagick OS X Installer [http://rubyforge.org/projects/rmagick/\]
RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618\]
RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html\]