25 ms·
The only bit about SystemD I'm not fully sold on is D-Bus. I love that everything is exposed via D-Bus, but the C API is incredibly difficult to reason about. I
by junon 5y ago
The only bit about SystemD I'm not fully sold on is D-Bus. I love that everything is exposed via D-Bus, but the C API is incredibly difficult to reason about. I've tried writing some higher-level bindings for it and it's still pretty difficult to get right.
Perhaps at some point they'll switch to something that's established instead of maintaining their own IPC protocol.
- Arch-TK 5y agoI've tried writing higher level bindings on top of libdbus. Once I realised that libdbus was not designed for writing reliable or sane software (there's an error? there's an error! what is it? who knows) I decided to try writing my own implementation of the dbus protocol (the intention was to write C code generators for automating away writing a lot of the boilerplate). Once I had read the specification once I gave up. dbus is the most hideous protocol and most hideous library, its ONLY advantage is its ubiquity.
- junon 5y agoYep. Sounds like we went down pretty much exactly the same path. I came to the same conclusion after attempting the same thing.
- awrmc 5y agoI disagree with this, in my experience D-Bus is very similar to other IDLs like DCOM, protobuf or ASN.1. If you're familiar with those, D-Bus should actually be easy in comparison.
- awrmc 5y agoD-Bus is the established IPC on desktop Linux. The libdbus library is pretty old and not great, you'll have better luck using one of the other implementations. I can recommend a few: - GDBus, if you're developing for GNOME - QtDBus, if you're developing for KDE - sd_bus, if you're writing low-level C - zbus, if you're using Rust For other languages, you'll want to look for bindings to one of those libraries, instead of bindings to libdbus.