3 ms·
I would too. I have the intuition that system-related programs tend to prefer C (and friends) for API compatibility: you can access all the syscalls no matter
by jjoonathan 5y ago
I would too.
I have the intuition that system-related programs tend to prefer C (and friends) for API compatibility: you can access all the syscalls no matter the ABI or weird memory semantics or even callback requirements. In theory, every language should have a standard library that exposes almost all of the system API surface, but in practice there's a long tail of awkward to implement and seldom-used API surface that most standard library writers just shrug their shoulders at.
But yeah, I'd be interested in hearing specifics.
- jcranmer 5y agoOn Linux at least, the relevant API for reading this sort of data is... open up specific files in /proc and parse the often poorly-documented textual output to get the information you need. Which happens to be the kind of thing that C/C++ don't do very well at all, at least in comparison to languages like Python. Although I think Linux is the outlier in this regard.
- freedomben 5y agowell, you're not wrong, but there are lots of libraries/wrappers around that interface that work pretty well