-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to GObject Introspection #1
Comments
Sorry for the slow response, I was in Greece for a week ^^ What would be the advantage of using GObject Introspection vs. creating bindings by parsing .h files? And what exactly is meant by "supporting" GIS? A program akin to bindgen, but for .gir files? |
Using GObject Introspection means we won't support them by ourselves and they are supported directly by the GTK+ team (we just parse the gir files). And if we do, we'll get a lot of other libraries which implemented GI. And we don't need to regenerate the binding after a update. GI supporting can be either compile-time or runtime. I don't know if Clay are flexible enough to play with the compile-time support. But though, runtime can always be implemented. https://live.gnome.org/GObjectIntrospection/HowToWriteALanguageBinding |
Hmm, I don't see how we could implement runtime bindings. Clay is a pretty statically typed language after all. So we would have to generate some clay bindings, either from the .gir or the .typelib files, ahead of time. These bindings would then have to be regenerated after an update, as before. Maybe I'm missing something? Or do you maybe mean integrating GI into the clay compiler? |
Vala integrated GI into the compiler and it works. I don't know whether the upstream would agree integrating it. |
Yeah, integration of GI into the compiler could be interesting... Maybe open a ticket there? But for this project, I still don't see the upside of using GI vs. running bindgen on the .h files. Maybe I'm still missing something. |
GI is more likely to be a dynamic binding like import gi.gtk; // here we don't generate anything about that. just runtime just write a dynamic module for Clay, that asks the GI Library to parse, and it does some magic, so we can use it just like a normal class or function. We don't need to do anything after an update. However I don't know if Clay can do that. :-( in fact, we still can make it a normal module. but it will lose all of the advantages. If Clay can't do that, maybe we must integrate it into the compiler |
I'm pretty sure this is not possible unless someone integrates GI into the compiler. I guess you'd have to open an issue in the clay repo and see what jckarter thinks about this. |
As everybody knows, GTK+3.0 comes with GObject Introspection, a dynamic language binding framework. Now many libraries support other languages with it. If we can use GObject Introspection, that means we've got many libraries for use (and GTK too)!
The text was updated successfully, but these errors were encountered: