There are already some ruby bindings but I’ve written my own.
I mostly did this for fun, but I think swig sometimes gives you slightly unnatural feeling interfaces, because you’re focussing too much on mapping C++ classes to your ruby classes. For example some liblinear methods take a struct param
argument. liblinear-ruby-swig mirrors this by proving an LParameter class that maps onto this:
1 2 |
|
but I’d rather write:
1
|
|
I imagine that SWIG must incur some sort of overhead but I would have thought that was pretty negligible for something like liblinear where most of the heavy lifting happens in the library being wrapped.