-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
decoupled C library, without python #1247
Comments
Yes, that is something I've been thinking about for a long time. One project I'm aware of which provides a "pure" C layer with on top the bindings for other languages is sigar.
A lot. This is massive and also has a cost in terms of maintainability ('cause C is less maintainable than Python) and stability ('cause you replace code which has been tested and used in production for years). I wouldn't go as far as saying it would mean starting from scratch but it's close. I imagine this as a 3-step process:
It's hard to tell how long this would take but it's surely in the order of months for steps 1) and 2), assuming a full-time investment (don't forget psutil runs on many platforms). This of course does not include 3), meaning other languages' wrapper implementation, unit tests, documentation, rethinking/adjustment of APIs and a proper and automated packaging/distribution, which implies a deep familiarity with them. In that case we may as well reach and exceed 1 year of development. |
Thanks for the detailed answer!
Ok, I didn't realize that python was used in the I agree a big refactoring sounds horrible. Using https://github.com/micropython/micropython could be a very interesting hack, though maybe a different type of unpleasant (build-system) work. |
The code in https://github.com/giampaolo/psutil/blob/master/psutil/arch/ is quite a trove of useful cross-platform voodoo. It's the most comprehensive that I've found. Projects like libuv are more conservative.
Has there been discussion about pulling the psutil C source into a separate project which could be included by other non-python C projects? Or, do you know of any efforts to do so? Or projects with similar goals?
How much effort would you estimate for this task? I would guess it's "just" a matter of removing the python bits.
I also wondered if https://github.com/micropython/micropython could be used as a bridge somehow, for projects that don't want to depend on the python universe, but I didn't check if that project is compatible with the python C API.
The text was updated successfully, but these errors were encountered: