Hacker News new | ask | show | jobs
by slovenlyrobot 2494 days ago
Having worked with GObject extensively, including through PyGObject, I can say the experience is infinitely better than trying to make C++ interoperate with e.g. Python.

(This coming from someone writing C++ since 2002)

2 comments

That makes sense since the implementation of things in GObject is basically the same as the internal architecture of Python. Since it's all just named properties and function pointers there's no chance that the compiler will rearrange it and break introspection. On the other hand there's also no chance that the compiler can optimize a GObject program, so you've traded good performance for an easier-to-use FFI for Python which might not be the trade I would have made. They've also traded away core developer productivity in order to make foreign language developers more productive, again a tradeoff I might not have made.
So is it a cornucopia of terrible ideas, or just a platform that has different goals and therefore tradeoffs?
> Having worked with GObject extensively, including through PyGObject, I can say the experience is infinitely better than trying to make C++ interoperate with e.g. Python.

Have you tried SWIG?

http://www.swig.org/

My current favourite is pybind11. I wouldn't wish SWIG on my greatest enemy :)