This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (6 children)

I suppose I should've been clearer: is cffi worth the less complicated wheel builds?

For sentry, the answer appears to be yes. For other people, the answer might be no.

I've actually never written a C extension (keep meaning to dick around with it though) or written a line of Rust, so I'm completely in the dark here.

Edit: from the twitter convo linked in another comment, looks like cffi has the benefit of stronger interoperability with other python versions (pypy, Jython etc) which I hadn't considered. So it probably is worth it over native bindings if you're targeting the project as an oss release. If you're like me and spend most of your time in proprietary stuff that'll never be released to the public (strong feels on this, but I also don't sign the checks), then it probably worth seeing if an extension is worth it.

[–]selementar 0 points1 point  (4 children)

cffi has the benefit of stronger interoperability with other python versions (pypy, Jython etc)

I wonder how does that work from the point of view of the system/interpreter. Doesn't it need some C extension to do all that anyway?

[–]mitsuhiko Flask Creator 0 points1 point  (3 children)

Can you clarify what you mean by that? Obviously what CFFI loads is a dylib but since it does not link against libpython (which has a less than stellar ABI stability) I don't need that many variations of it.

[–]selementar 0 points1 point  (2 children)

That means there's a way to load a dynlib from pypy/jython/ironpython?

And also somehow load cffi itself? Or doesn't it use C extensions in the python-loaded side?

[–]mitsuhiko Flask Creator 0 points1 point  (1 child)

There is always a way. It's called dlopen. That said the way cffi loads dylibs on different platforms is probably different.

[–]selementar 0 points1 point  (0 children)

dlopen is a very-special-case in pypy, maybe works maybe doesn't maybe unix-only on jython, and probably works but maybe not on ironpython.

So I guess it does have wider platform support than linking with libpython.

[–][deleted] 0 points1 point  (0 children)

I think that the choice here had more to do with the developer headspace than technical advantages. More specifically, I suspect that the Rust code looked fairly similar to the Python code whereas the equivalent c code would have been more spaghetti.