Re: Plans for 2.8 - GNOME Managed Language Services?



>  - make full introspection data on the GTK+ API more formally part of 
>    GTK+, so language bindings aren't maintaining this themselves

I'd just like to make a few (hopefully interesting) technical points
about this.

Adding introspection metadata to GTK+ for use by bindings is certainly
a good idea. However I feel that it is very important that this metadata
is maintained "the right way". For a precedent where the same problem
has been solved elegantly, look at EJB (Enterprise JavaBeans). The
problem with EJBs used to be that you needed to define a lot of metadata
to be able to use them (like 3 additional classes and a bit of xml
per class that you wanted to turn into an EJB). Luckily, something
called XDoclet came along. It's a way to move all the needed metadata
into "code annotations", which are special code comments à la gtk-doc
and javadoc. The big advantage of this is of course that it's much
more maintainable than separate .def-files.

To keep this short, here's what I think would be nice:

- Add the necessary metadata to the sources as code annotations
  (in gtkdoc-like comments).

- Hack up gtkdoc to parse these. Have it generate one .def-file
  in a common format for all bindings to use.

- Have the hacked gtkdoc generate a kind of "type library" from
  the sources.

- Add type library support to gobject, such that for any gobject-
  based type, the type library can be found, loaded and used
  at run-time. Alternatively put this support into another library
  that can be used by language runtimes and virtual machines.

In the end this would be a way to enable java-like introspection
on gobject based types, usable from C and thus any language.

By keeping the metadata within the source code, maintenance would
be much simplified (can't stress this enough).

Cheers,

Christian Glodt





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