Skip to content
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

Python binding #34

Open
nemequ opened this issue Aug 27, 2013 · 3 comments
Open

Python binding #34

nemequ opened this issue Aug 27, 2013 · 3 comments

Comments

@nemequ
Copy link
Member

nemequ commented Aug 27, 2013

It would be nice to have Python bindings.

@rmax
Copy link

rmax commented Feb 13, 2017

What's your preference for the official python bindings? The options are:

  • C-based bindings: Writing C code directly, minimum call overhead. Requires dealing with Python 2/3 support by yourself.
  • Cython-based bindings: a little overhead in the generated wrapping functions but easier to maintain and supports Python 2 & 3 out of the box.
  • CFFI-based bindings: This allows to support PyPy.

From what I have seen in the wild, official bindings are either pure C-based or Cython-based, it's matter of preference of the maintainers.

@nemequ
Copy link
Member Author

nemequ commented Feb 13, 2017

I really don't have a preference; I don't do Python (or any dynamically typed language if I have a choice), so I don't think I'm really qualified to have an opinion.

The one preference I do have is that I would prefer to have it built, at least optionally, by Squash's build system instead of requiring a second build system (i.e., a setup.py script). I don't mind helping implement the CMake bits.

@jakirkham
Copy link

There are a couple of other options beyond the ones already listed. Most notably Boost.Python and SWIG. The former mainly makes sense if you already are writing C++ and use Boost. SWIG exists mainly if you want lots of bindings to your code from many different languages.

That said, having written bindings to Python before, I would recommend Cython. Way less work to get started and way less work to maintain. That said, if you prefer writing/maintaining C normally, C-based would be reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants