GNOME Bugzilla – Bug 649548
Full introspection/reflection API
Last modified: 2011-05-20 17:24:47 UTC
At the moment support for introspection relies on gobject-introspection. However, this API is only to provide metadata for public API/shared libraries to enable auto-generated bindings and does not support: 1. executable programs 2. nested namespaces It would nice to have full, native support for introspection/reflection in Vala ala Java and C# reflection.
GObject introspection should work fine for applications as well, as far as I know. GEdit uses it. I don't intend to start my own introspection/reflection API for GObject-based libraries just because GObject introspection does not currently support nested namespaces.
It's not just for support of nested namespaces, but also for non-shared libraries like executable programs. Reflection is a powerful tool for modern languages, and has many useful applications wrt attributes, it would be a shame not to see this in Vala. Please reconsider closing this defect.
(In reply to comment #2) > It's not just for support of nested namespaces, but also for non-shared > libraries like executable programs. Where do you get the idea that GI does not work for applications? GEdit uses GI just fine, as far as I can tell.
Isn't GObject-Introspection's focus narrower than providing general metadata? Reading around the subject, it seems it's to provide metadata for public API/shared libraries to enable auto-generated bindings which is why, as I understand it, it doesn't support executable libraries. Valac won't generate GIR data for executable libraries AFAICT.
See this discussion for more information: http://mail.gnome.org/archives/vala-list/2011-April/msg00105.html
"executable libraries" above should read "executable programs".
There might be bugs/missing features in this area in Vala and/or GObject Introspection, however, I don't see a fundamental reason why we couldn't improve these components to provide a full introspection/reflection API. GI can definitely already be used for classes that are just in the program and not in any library. If there are specific issues in Vala and/or GObject Introspection, we should work on these and not start from scratch on a second implementation.
I'm not sure that that GI can definitely already be used for classes that are just in the program, that seems to contradict what I've read on the subject. I'm sceptical that the GIR people would ever be willing to modify their API, seeing as they don't see it being used for anything except to enable auto-generated bindings. Especially given their reasons for rejecting support for nested namespaces: https://bugzilla.gnome.org/show_bug.cgi?id=576327