4 ms·
I mostly agree with you, whenever I want to put a simple native linux gui on top of some tool I'm disappointed by the difficulty of the GObject api. However, on
by rjeli 6y ago
I mostly agree with you, whenever I want to put a simple native linux gui on top of some tool I'm disappointed by the difficulty of the GObject api. However, one advantage is that the C abi hasn't budged as the binary lingua franca. The C++ abi can change, but that only happens every decade or so, so it's not that bad. The worse part is that most FFI libraries always support C perfectly and C++ is always "experimental". So you can quickly throw together a library for a language that wraps GTK without worrying about the ABI. The downside is, obviously you want to smooth over GObject in MyCoolPyGTK, so each library develops its own API which you have to learn over and over, and you end up with 12 tabs open of the shoddy MyCoolPyGTK docs, GTK docs, GObject docs, and reverse engineering how they talk to each other behind the scenes. /rant
- MaxBarraclough 6y agoHow does it compare against COM?
- p_l 6y agoFrom my understanding, pretty badly. COM having an IDL and being way more explicit about things helps.
- hedora 6y ago> However, one advantage is that the C abi hasn't budged as the binary lingua franca. That’s nice in theory, but hasn’t gtk stopped providing API compatibility between minor releases?
- rjeli 6y agoYeah, but that's a slightly different issue. C abi stability means you can use whatever off-the-shelf ffi your language supports.
- thayne 6y agoThat's not the point. The point is other languages don't have FFI for c++ because it doesn't have a stable/standard abi, so it's much harder to make bindings to qt than to gtk for most languages.
- hedora 6y agoVersion one might take a bit longer, but you don’t have to re-write the qt bindings every three months. I’m all for ABI stability, but without API stability, it’s meaningless.
- thayne 6y agoFirst of all Gtk doesn't require a rewrite every three months... Secondly, at least for dynamic languages, you typically don't need to worry about wrapping Gtk's API, you just wrap GObject, and use introspection to dynamically generate classes.
- p_l 6y agoJust every major release you have to start from scratch, again, including any tooling you might have had for previous version now requiring rewrite from scratch.
- thayne 6y agoI really wish there was a standard stable ABI for namespaces, vtables, and maybe name mangling operators and overloaded functions. In other words, a standard ABI for OOP APIs. The problem with C++ abi isn't just that it can change, but that it is implementation defined,so different compilers produce different abis.