This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Plugins, Guile, and Gimp


Greetings:

	I am by no means an expert on anything, and what I'm about to
say just may have no relation to reality.

	In Jim Blandy's "Guile Project Ideas", he mentions a project
in getting the Gimp people to start using Guile (instead of SIOD).
This project is closely related to what I'm doing at the moment too
(building a 3D modelling program with support for several
extension languages).

	I've been examining The Gimp source code fairly closely and
I've determined (well mostly) just how it hooks up with SIOD.  There
seems to be a problem.  I'll explain in more detail, but for the
impatient, it seems that SIOD provides a registered procedure with the
name it was called by.  I can't seem to find a way to do this in
Guile (which doesn't necessarily mean it can't be done).

	For the more curious, The Gimp keeps a database of procedures
(the procedural database).  Plug-ins register themselves with the
database and therefore become accessible to everything that has access
to the procedural database.  Script-Fu is a plug-in that exports the
procedural database to a Scheme interpreter.

	The interesting part is that Script-Fu doesn't actually
register procedures from the procedural database.  Instead it
registers the same proxy function for each and every procedure in the
procedural database.  This proxy function then determines what name it
was called by and then calls the appropriate procedure from the
procedural database.  If you think about it, this makes perfect sense
because the proxy function can do any argument and return value
conversions, and therefore effectively shield SIOD and the procedural
database from one-anothers internals.

	So, is there a way of doing this sort of thing in Guile?  Can
anybody point me in the right direction?  From what I can tell, it is
definitely not possible using the 'gh' interface.
--
				Mark A. Fox
				mfox@cpsc.ucalgary.ca

	"Never underestimate the bandwidth of a station wagon full of
tapes hurtling down the highway."
                                - Tanenbaum, "Computer Networks"