Is GLib universal library?

Reply to what comment?

That should answer your question on whether GLib will work on a particular Linux (non-GNOME) environment.

I didn’t asked that. I was worried that GLib would have been GNOME’s library. For example, I can’t think of using LibAdwaita outside of GNOME, because that library is dedicated for GNOME; development is made with (only) this in mind. Then think libcamera or glibc (okay, glibc is a bad example) which are for Linux in general. Do you see the difference?

Can’t you see? Think about the naming (GLib → Gnome or GTK library), sources of the project is on gitlab.gnome.org/GNOME/, the documentation is on docs.gtk.org/glib/, nowhere mentions of the developer (that is GLib Team) and that suggest it’s just GNOME’s project, GNOME is one big user of it, see the Wikipedia page and Google “GLib”. I’m not the only one and e.g. this Reddit post calling it “glib, gnome base library”. Basically everything suggest it’s GNOME’s project and not separate, independent project.

Agree, but IMO GLib Team could be clearer in communication here. Own website (why the documentation is on gtk.org??), clearer README and update fix the Wikipedia page.

And, isn’t gsettings quite GNOME spesific?

What about in Debian and apt?

And it’s pretty hard to say about that. I mean e.g. KDE apps can use GLib for some parts to support e.g. gsettings, but then the app doesn’t really use GLib if only 1% of the app use GLib.

:+1:

No, sorry. If I look at the first paragraphs in the readme and docs, they say:

It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.

GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on.

That seems pretty clear to me what it is – These are just standard tools you can find in many similar platform libraries. Note how the readme and docs are the primary sources for information that GLib developers can actually edit. GLib developers do not have any control over Wikipedia or over random posts on Reddit. I am sure a Wikipedia editor could edit the page to make this clearer though.

No, it can use GSettingsBackend to change the storage format.

In Debian the command is this:

apt-cache rdepends libglib2.0-0

That is normal, GLib as a library is “wide” instead of “deep” if that makes sense, just like any library with many smaller components. Programs can choose to use small parts of it or they can choose to use a lot. I would say there is even no GNOME app that uses all 100% of GLib, each app uses the different parts it wants.

At the beginning:

GLib is the low-level core library that forms the basis for projects such
as GTK and GNOME. It provides…

Sure, I also know what it is (a general-purpose library for C), but as library called GLib I think it could be a general-purpose library especially for GNOME or GTK. Good that you all now told me that GLib is separate thing from GNOME and GTK projects : )

@jfrancis: What is platform in that context? GLib is apparently ‘platform library’, but what is that platform? GLib platform or Linux platform or? :sweat_smile:

Agree, but in my list was many things that together created an impression. The Reddit post was just an example of the fact that there is many that thinks the same.
And still, why e.g. the documentation is on gtk.org?

What does it change? I think dconf (that backend) isn’t gnome spesific, but gsettings is. Maybe I’m wrong, but anyway.

Thanks for that, and thanks for all your answers!

I didn’t mean that. I meant that if the app only uses GLib only for compatibility in special cases (if e.g. KDE app want add support for gsettings for gnome users) and don’t use in regular code parts. Dont use g_fprint() etc at all.

Sorry, I still cannot see what the issue is here or where you are getting this impression. Aside from other things like the Reddit post but I try to avoid getting impressions from those as they are less reliable sources.

Because something is the basis does not suggest that it is owning that thing, it is actually more the opposite. For example the C language and the POSIX standards and the various parts of the build toolchain also form the basis that GTK and GNOME is built on. (GTK, GLib, GNOME, Flatpak, etc are all very dependent on those underlying technologies, not the other way around).

This ties into a larger point about engineering – complex programs are built by layering abstractions on top of each other. GLib contains abstractions that are lower level compared to GNOME, so it makes no sense to suggest that these are “GNOME dedicated abstractions” or something like that.

Probably a few reasons, but for one, glib.org is not available.

This question has already been answered previously in this topic so I don’t want to copy and paste. If it is not clear, please ask a more specific question.

No, it is the other way around. GSettings is just an API for a key value store. Dconf is a database generally used by GNOME to store GSettings data. If you are just a developer writing apps with GSettings you can use any storage format or database, including dconf, or something else of your choosing.

That is not a special case. Because GIO supports extensions then using it just for compatibility with some other thing is also a normal usage. In this situation it is because they wanted to use the dconf backend to access GNOME settings but they could also use it for any other GSettings backend or any other data format that has a way to access it through GIO if they wanted more compatibility with other things.

Platform usually means the operating system. Whether it be GNU or Windows, etc.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.