News for hackers. Stuff that matters.
Re:GTK has a new website by einpoklum on Sunday March 01, 2020 @07:32PM (#22460492)
But the whole point is that I don't _want_ to use Glib/Gobject's. I want my own language's objects (more often than not - C++).
Re:GTK has a new website by PaulDavisThe1st on Sunday March 01, 2020 @08:37PM (#22460837)
I write a "major" app that uses GTK (via Gtkmm, the C++ language binding). We don't use GObject for anything that isn't already a part of GTK. Put differently ... if we implement or extend a widget, it will necessarily inherit from GObject. But if we implement our own non-GUI objects, we just ignore GObject entirely.
Re:GTK has a new website by ptx on Sunday March 01, 2020 @08:27PM (#22460784)
Well, I also want to use my own language's objects, and GObject Introspection enables that.

With a library written in C++ I can't do anything from most languages. Very few languages offer C++ interop.

What language would you suggest the platform GUI library should be written in if not C? You can't use Qt's C++ objects from Java or Swing's Java objects from C++, but both can call C.

Re:GTK has a new website by lmm on Sunday March 01, 2020 @11:33PM (#22461691)
You can - and do - use Qt's C++ objects from Python in a very native way, as though they were just ordinary Python objects. I would imagine the same would be the case when using Qt from Java or any other language that offers bindings. And since C++ with its class system is a widely adopted standard (for good or ill), there is at least some appetite for offering good bindings to object-oriented C++ libraries among the wider community, and any improvements or techniques there will generally cross-pollinate to improved bindings for Qt and vice versa.

In theory GObject is intended to be a whole parallel OO ecosystem, a better way of doing objects in C-like languages that can compete with C++, and that would ultimately give rise to a whole platform of things like Vala that interop with that platform. However that whole ecosystem just hasn't caught on; outside of Gnome, no-one is using GObject, no-one is using Vala, and so no-one else is interested in working on bindings between other OO languages and GObject (which have to solve much the same problems as bindings between those languages and C++ - GObject may be "C" but it relies heavily on macros, and to bind it in a usable way that makes it feel native in an OO language you have to do a lot more work than just exposing C functions as functions).

Re:GTK has a new website by xfer on Monday March 02, 2020 @12:40AM (#22461930)
There is a reason there aren't any close to complete bindings for other languages except python for Qt5. It takes significant effort compared to binding to Glib/Gobject especially with gir.
Re:GTK has a new website by einpoklum on Monday March 02, 2020 @12:03PM (#22466238)
Qt is not a "fair" comparison. I mean, yes, it's relatively popular, but:

1. It's a huge framework, not just a GUI toolkit. 2. It uses the not-really-C++ mechanism of signals and slots and a "meta-object compiler".

Thus, for example, wxWidgets - written in C++ - has bindings in Lua, Python, Ruby, Rust, Java, Javascript, etc.

Re:GTK has a new website by einpoklum on Monday March 02, 2020 @09:47AM (#22464817)
> GObject Introspection enables that

By definition, not really. I can't be not-using GObjects if I _am_ using GObject introspection.

> Very few languages offer C++ interop.

bu they do offer Glib interop? I don't mind having a C API (for a C or C++ library), and modern C++ inside.