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

Michael Barton mail at michaelbarton.me.uk
Tue Feb 22 19:43:09 UTC 2011


That's useful to know. I was familiar with FFI but I didn't know it was the
preferred approach in Ruby. I'm learning C and hoping to use it where necessary
for solving bottle necks.

On Tue, Feb 22, 2011 at 07:47:41PM +0100, Pjotr Prins wrote:
> 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