[BioRuby] FFI to Smith/Waterman and Needleman/Wunsh C-extension

Pjotr Prins pjotr.public14 at thebird.nl
Tue Feb 22 18:47:41 UTC 2011


On Tue, Feb 22, 2011 at 11:48:21AM -0500, Michael Barton wrote:
> Thank you Naohisa and Francesco for your suggestions. I will try experimenting
> with these two libraries. I had also just read an interesting article on using
> C extensions in Ruby which I thought might be of general interest to the
> mailing list -
> 
> http://robots.thoughtbot.com/post/1037240922

This discusses using a Ruby C interface. Note: it is not the easiest
way. Especially with existing C libs you may be better off with FFI
or SWIG. The first makes mapping to Ruby easy, the second maps to all
languages. For most Ruby bindings FFI is preferred, also because it
does JRuby.

Binding existing libraries is usually non-trivial. Because C has no
GC, and buffers get passed around as function parameters.

Pj.



More information about the BioRuby mailing list