RFC: haskell bindings to procps and higher-level library

I just stumbled across a project I was working on early last year. Evidently I must have got distracted by something else. Nevertheless, the project seems to be in decent shape with good documentation (missing a README but the haddock docs are complete). I’ve made the repo public and uploaded package candidates here and here.

If anyone wants to take a look and let me know if this could be interesting, or has any useful feedback, that’d be

procps-bindings is bindings to the procps C library, and hprocps is a more idiomatic mid-level library. Enjoy!

4 Likes

Definitely seems useful! Two things:

  1. You might want to use OsPath instead of the old FilePath. Support for the former is a bit sparse yet, but it doens’t help to further the latter’s use
  2. Linking from the high-level bindings to ProcTabInfo which is in the low-level bindings (with CUInt in it) is a bit jarring. I think users expect a higher-level type here.

Good work though, separating the raw bindings and the higher-level interface, and with the docs.

2 Likes

Thanks for the feedback!

Regarding OsPath, I’ll look into implementing this since according to the docs it has better performance. But since procps is Unix-only, we won’t benefit from the cross-compatibility.

Good point about the mix between low- and high-level, I’ll have a think.

Edit: I’m new to OsPath but I can’t find in the docs an easy way to peek an OsPath, e.g. something like peekOSPathLen :: CStringLen -> IO OsPath. I could just peekCStringLen >=> encodeUtf, but that seems like needless roundtripping. Any ideas?