Suppose I have a pure C library and I want to use it in Ruby or NodeJS. As far as I know, I should write a binding to the C library from my environment.
What I want to know is how this binding is possible and what the remedies are.
Suppose I have a pure C library and I want to use it in Ruby or NodeJS. As far as I know, I should write a binding to the C library from my environment.
What I want to know is how this binding is possible and what the remedies are.
To connect to a C library from Ruby, you can use the FFI gem. It stands for Foreign Function Interface and seems to be doing what you want. There are RubyTapas series of episodes of how to use it.