guile-devel
[Top][All Lists]
Advanced

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

Re: What replaces scm_register_module_xxx (Doc update?)


From: Matthias Koeppe
Subject: Re: What replaces scm_register_module_xxx (Doc update?)
Date: Fri, 09 Aug 2002 10:47:50 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.80 (sparc-sun-solaris2.7)

address@hidden writes:

> On Thu, Aug 08, 2002 at 09:31:51AM -0500, Rob Browning wrote:
>> "Dale P. Smith" <address@hidden> writes:
>> 
>> > The new method is to use a .scm file that defines the module,
>> > dynamically loads the compiled code, and then exports whatever you
>> > need.
>> 
>> Right.
>> 
>>   (define-module (foo bar))
>>   (load-extension "libguile-foo-bar-v-1" "init_guile_foo_bar-v-1")
>>   (export foo-1)
>>   (export foo-2)
>>   (export bar-1)
>>   ...
>
> I think there's a misunderstanding/misconception here (or, better:
> in guile's current C api). The 'load-c-functions-through-scheme' 
> aproach might be fine and all that's needed as long as we only want
> to extend _guile_ (the application) with external libs. But guile
> is inteded to be an embedded srcipting language as well (at least that's
> what the documentation says). If i want my users to be able to script
> some of my applications functionality there's no library i can load
> with 'load-extension' -- of course i could put the tiny scm_* wrapper
> functions into a dll and have _that_ loaded, but i wouldn't call this 
> good design practise (oh, i could 'load-extension' my own application
> instead, but that's not really portable ...). Having to provide (and
> deploy!) scm file(s) just to be able to put my functions into different
> modules feels clumsy. 

Indeed.

I just want to point out that there was a similar discussion back in
May 2001 ("On the deprecated auto-loading of compiled-code modules").
See

    http://mail.gnu.org/pipermail/guile-devel/2001-May/thread.html#1922

Back then, I had complained that I could no longer do module business
from C after scm_register_module_xxx became deprecated.  

After some discussion, Marius wrote
(http://mail.gnu.org/pipermail/guile-devel/2001-May/002171.html):

# Ok.  It's "Drastic Measures Time".  [Thinking as I type...] People
# should be able to handle modules from C, in a way mostly similar to
# how they do it from Scheme.  We don't want to guarantee the lower
# level module operations to be stable, but the higher level ones should
# be OK for quite some time (even when we get a totally new module
# system, I hope that we can find a way to integrate the higher level
# features in a backward compatible way).

He proposed and implemented a C API for defining modules and exporting
symbols, see

    http://mail.gnu.org/pipermail/guile-devel/2001-May/002171.html

I use this API in the Guile back-end of SWIG (http://www.swig.org).
The functions are also mentioned in the NEWS file of Guile (changes
after release 1.4).  The API is also used in
examples/box-module/box.c.

I believe it's only an accident that the functions are not documented
(except for the NEWS blurb).  I think documentation should be added;
the changes should also go into the 1.6 release.  Preliminary
documentation can be found in the above message by Marius.

Regards,

-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]