-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby wrapper #27
Comments
I am not very familiar with the internals of Ruby, but I am happy to provide guidance for the effort. |
Works :) Should we use SWIG or is it ok to use the Ruby C API directly? Any specific reasons why you used SWIG for the python bindings? |
SWIG will likely make your life easier if you have straightforward type mappings. I may write a Cython binding for paratext (mainly to simplify talking to other Python modules that use Cython -- you can define an internal C API via pxd files) but either way it makes for less work than a hand-coded C extension for Python at least. |
Alright. I'll explore all the options and post them here soon. Thanks :) |
Hi. I went with SWIG because it does a lot of the hard work of parsing and validating input for you. If you write your own wrapper, you have to write a lot of boilerplated code yourself. Given a large enough codebase (100K+ lines), custom wrappers become very hard to maintain. The Python typemap lives here:
You need to write template functions to convert from C++ containers to Ruby arrays.
You also need to write a function to convert CSV columns to Ruby arrays:
This is needed to call the Best, |
It would be great to have a Ruby wrapper over paratext to bring fast CSV reading to Ruby.
We can use it in daru, for example.
The text was updated successfully, but these errors were encountered: