You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to use this from other languages, such as Julia, without requiring a Python dependency. Since the core functionality here is already implemented in C, would you ever consider refactoring it into a Python-independent C library + a Python interface, so that non-Python languages could call the C library directly?
I realize that this is a nontrivial amount of work because currently your C code is intertwined with calls to libpython, but it seems (at first glance) like something that would be doable in a week or two. (Or is there some major obstacle I'm missing?) I'd be willing to help, but only if this is something that would interest you.
The text was updated successfully, but these errors were encountered:
it seems (at first glance) like something that would be doable in a week or two
I think you are seriously underestimating how big of an effort that would be. :) It's not only about making the C extensions return generic C types instead of Python types (there's a Java lib called cigar which does this), but also providing decent support support for those languages: redesigning APIs, documenting them, writing tests for those languages, add CI, (possibly) distribute binaries etc.
Above all: be ready to handle and keep up with the new influx of bug reports and PRs, which considering psutil's numbers are probably gonna be a lot.
Another thing to consider is that a rewrite of that size would almost certainly introduce regressions to the existing 15+ years old Python implementation, especially on Linux (which is the major platform), since the parsing of /proc would have to be rewritten from scratch in C.
It's not something I never thought about doing (I did), but I know it would end up being a full-time job in the literal sense, which would also probably require a team of people.
but also providing decent support support for those languages: redesigning APIs, documenting them, writing wrappers for those languages, unit tests, add CI, (possibly) distribute binaries etc.
I was thinking of just refactoring psutils to have a C-callable API, and then adding a Julia interface. Other languages would be on their own to add a wrapper.
since the parsing of /proc would have to be rewritten from scratch in C.
Ah, I see, I thought everything for Linux was in _psutil_linux.c, but now I see that you have a ton of stuff in _pslinux.py etc. that would be a pain to rewrite.
It would be nice to be able to use this from other languages, such as Julia, without requiring a Python dependency. Since the core functionality here is already implemented in C, would you ever consider refactoring it into a Python-independent C library + a Python interface, so that non-Python languages could call the C library directly?
I realize that this is a nontrivial amount of work because currently your C code is intertwined with calls to libpython, but it seems (at first glance) like something that would be doable in a week or two. (Or is there some major obstacle I'm missing?) I'd be willing to help, but only if this is something that would interest you.
The text was updated successfully, but these errors were encountered: