Re: Introspection use cases




On Feb 25, 2005, at 4:39 PM, Owen Taylor wrote:

* "Libglade"

  - Should be possible to create a "libglade" equivalent that
    uses introspection information to locate _get_type()
    functions.

this, and the previous one about GUI builder, would be far superior to libglade/glade's current method of supporting extra widgets.


* Dynamic language binding

- It should be possible to create a "good" language binding
   that works purely from introspection information.

I'm already pondering this for gtk2-perl, especially in conjunction with some other libraries at work for which i have gtk2-perl-based bindings. The amount of work potentially saved makes me salivate.


  Obviously, matching an existing API or writing language
  specific convenience functions would require custom glue.

Have also considered this. Gtk2-perl's current method of making custom wrappers for boxed types (e.g. turn a struct into a native perl hash) and stack handling (we hide GList and GType from perl completely) will mean that we can't get by without at least some glue. Also, for backwards compatibility, we'll probably have the new introspection-based binding engine used only for supporting stuff from gtk+ 2.$version_in_which_introspection_is_introduced forward, and go to full introspection at gtk+ 3.0.


- It should be possible to implement interfaces in dynamic
  language bindings.

Given how much work it is to support these in gtk2-perl at the moment, this is also exciting.


* Cross language interchange of objects
...
   $ gobject-wrapper fspot.xml -o libfspot.so.0
    --include-output-dir=fspot

Have you any thoughts for how to support this from dynamic languages? I'd love to be able to use some of my perl GObjects in python and even C programs -- porting them to C isn't very fun.


--
I think it worked on the Wiley Coyote model of project management - if
at any point you looked down and realised what you were doing was
impossible then you'd instantly fail.
  -- Simon Wistow




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]