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]

Re: Dynamic loading of extensions?


Norbert Preining <preining@logic.at> writes:

> Hi out there!
> Now there is guile-gtk, gnomeg, guile-tcltk, and and and. Why is it
> not possible to load all these extensions dynamically, at least on
> systems like linux. Elk e.g. can load quite a lot of different modules
> at runtime, linking them and executing some special code, usually the
> _init_module funtion or so. Is this planned for guile?

Yes.

> It would be nice to do
> (use-modules (extensions tcltk))
> and ... - clear.

You're right.

> Would be nice to hear some suggestions.

Well, the big holdups so far have been:

* Limitations of the dyn-loading code.  
The current stuff is somewhat hackish and awkward, and some people
(guile-gtk) have written an alternative.

* No standard way to do things.
There are at least two different implementations of dyn-loading, and
nobody quite knows where to put a dyn-loaded module.  In particular,
it's not clear how to make an easily-buildable library that can be
loaded dynamically, loaded statically, or built into its own guile.
(Static loading is useful in combination with the limited unexec we
have now).

* No easily-accessible tutorial.
I've been told there's a tutorial out there, but I couldn't find it on
red-bean and I lost the original URL (assuming it was going to on
red-bean). 

* Impending change to the interface
There's a lot of moaning and groaning about guile's module system.
People have been asking for a new one for over a year now, and it
still hasn't been done.  Nobody has even come up with a coherent list
of requirements, other than "better".

* Periodic breakage of dyn-linking in snapshots.
I have occasionally had difficulty getting dyn-linking to work; once
in a while, it was the snapshot.  In fact, AFAIK, libtool libraries
are broken in the current snapshot (the patch hasn't gone in yet). 

On the plus side, there are some examples.  A dead-simple example
would be the guile-gdbm package (which is unportable and old).  A more
portable, elaborate and crufty example would be the rx package from
guile-lang-allover. 

There are no strong technical reasons not to put a dyn-linking
implementation of most libraries.

Andrew