unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
Cc: ttn@glug.org, guile-devel@gnu.org, guile-user@gnu.org
Subject: Re: [d.love@dl.ac.uk: dynamic loading of native code modules]
Date: 14 Apr 2002 23:22:28 +0100	[thread overview]
Message-ID: <a9cvp8$kks$2@main.gmane.org> (raw)
In-Reply-To: 874rifqeo8.fsf@raven.i.defaultvalue.org

>>>>> "Rob" == Rob Browning <rlb@defaultvalue.org> writes:

    Rob> Neil Jerram <neil@ossau.uklinux.net> writes:
    >> The description you gave of the Emacs patch glossed over one detail -
    >> what's the name of the function that gets called to initialize the
    >> dynamically loaded module?  I think it would be acceptable to derive
    >> it algorithmically from the module name (and obviously impose this as
    >> a requirement on the module coder).

    Rob> Some of the higher level abstractions and flexibility sound
    Rob> good, but I'm a little concerned about automatically
    Rob> generating the init function from the module name -- this
    Rob> makes it hard (as I mentioned before) to create modules that
    Rob> share the same C lib or modules that require multiple C libs.
    Rob> It may also make it difficult to easily wrap up existing libs
    Rob> without having to create unnecessary "dummy stub" libs, and
    Rob> feels a little like overspecification.

Ah yes, I remember the discussion now.

    Rob> Of course this would only be a problem if it was the *only*
    Rob> interface.  If we also provided a flexible enough low-level
    Rob> interface for loading shared libs, then having a more
    Rob> automagic, optional higher-level interface might be fine.

I'm pretty sure that Thi was wanting to reinstate (use-modules ...)
support _in addition to_ keeping load-extension and dynamic-call etc.

    >> If we can agree this, it would be good to do it in 1.6, for
    >> continuity.  (Of interface, I mean; module coding would change
    >> slightly, as just stated.)

    Rob> My current plan is for 1.8 to have versioned scheme level
    Rob> modules (i.e. use-modules modules), and some workaround that
    Rob> allows for versioned dynamic-link'ing (in part to avoid
    Rob> libtool problems with installations of multiple guile
    Rob> versions), so I don't think there's much chance for seamless
    Rob> continuity between 1.6 and 1.8 anyway.  Given that, I don't
    Rob> think it's worth holding up 1.6 for this, and in truth, my
    Rob> personal feeling (given my experiences with the module system
    Rob> and shared libraries while working on gnucash, g-wrap,
    Rob> mainstream guile, and other projects) is that the current 1.6
    Rob> system is a lot easier to follow.  In the normal case, by
    Rob> looking at one .scm file, you know exactly what's going on,
    Rob> and what's part of a module's interface.

    Rob>   (define-module (foo bar))
    Rob>   (dynamic-call "my_init_func" (dynamic-link "libmylib"))
    Rob>   (export func1)
    Rob>   (export func2)
    Rob>   ...

Using this kind of approach, is it always possible to emulate the
effect of the old use-modules behaviour by installing a .scm file that
loads the required library?

If it is, then that's probably sufficient for 1.6, and I'll add
something to the docs to make that clear.

    Rob> (load-extension might also (should?) be used here).  To me
    Rob> this code is *really* clear, but other people's mileage may
    Rob> vary :>

Yes, load-extension should be used here.  The difference is that
load-extension provides a way of handling the case where the LIB is
already statically linked in.  (And the case where it has previously
been dynamically linked?)  I think the code is still pretty explicit:

(load-extension "libmylib" "my_init_func")

    >> More generally, looking back through mailing list history, it's
    >> actually astonishing how much support for various stuff that Guile
    >> has _lost_ along the way.  My overall impression is that we
    >> (collectively) have been too glib about this.

    Rob> I guess I'd have to disagree here too.  Most of the stuff that I can
    Rob> think of that we've "lost" actually makes guile cleaner and less
    Rob> confusing to me, and the stuff that we've added (or are adding) makes
    Rob> guile much more useful.  As examples of things we've done or planned
    Rob> since 1.4:

    Rob>   drop gh_* -> less confusing

    Rob>   add documentation for scm_* -> more useful.

    Rob>   add goops -> *much* more useful

    Rob>   adding GMP -> (for bignums -- on the way to rationals?) more useful

    Rob>   fixing libtool versioning issues -> more useful (more packagable)

    Rob>   planning to drop certain macro "flexibility" so we can support a
    Rob>   clear evaluation model and perhaps eventually support compilation ->
    Rob>   more useful.

    Rob> etc., but do you have particular things you think we've dropped that
    Rob> have actually hurt substantially?

    Rob> Overall I think guile may have (had?) a bit of excess baggage, and
    Rob> I've felt like there's likely to be a decent amount of pruning,
    Rob> pruning which should make guile stronger, before it becomes the
    Rob> extension languge (and perhaps often scheme implementation) of choice
    Rob> if it *is* going to.  I guess rightly or wrongly I've been considering
    Rob> 1.6 and 1.8 to be fairly serious "housecleaning" releases...

Well, I agree with all the examples you give here, but what about the
following?

- dropped support for multibyte strings  [unless I'm misunderstanding
  the old mailing lists, Guile used to have these !]

- dropped/lost support for Tcl/Tk

- dropped/lost support for Ctax and other things (parser, rx etc.)
  in the guile-lang-allover package (or guile-rgx-ctax in CVS)

- dropped/lost support for Hobbit compilation

Now, apart from multibyte strings, none of these should be in the core
(and I haven't checked whether they were ever distributed as such).
Most of the examples here are to do with compatibility of Guile core
with its surrounding packages, and so shouldn't conflict with the
wonderful pruning/cleanups that have been going on in the last couple
of years (and which I totally support).  So how did we lose them?

I shall resist the temptation to quote Lady Bracknell.

        Neil


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2002-04-14 22:22 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E16vpWV-0001wJ-00@giblet>
2002-04-13  8:50 ` [d.love@dl.ac.uk: dynamic loading of native code modules] Neil Jerram
2002-04-14  0:34 ` Rob Browning
     [not found] ` <m3n0w8ugmp.fsf@laruns.ossau.uklinux.net>
2002-04-14  0:58   ` Rob Browning
2002-04-14 21:30   ` Marius Vollmer
     [not found]   ` <874rifqeo8.fsf@raven.i.defaultvalue.org>
2002-04-14 22:22     ` Neil Jerram [this message]
     [not found]     ` <m3bsclsyxn.fsf@laruns.ossau.uklinux.net>
2002-04-15  4:21       ` Rob Browning
2002-04-15 12:15       ` Marius Vollmer
     [not found]       ` <87lmbpiocf.fsf@raven.i.defaultvalue.org>
2002-04-15 13:27         ` "byte compilers, was " Bill Schottstaedt
2002-04-24  7:34           ` Thien-Thi Nguyen
2002-04-16 20:23         ` Neil Jerram
     [not found]         ` <m3sn5vpf43.fsf@laruns.ossau.uklinux.net>
2002-04-17  5:25           ` Rob Browning
2002-04-20  8:14           ` Thien-Thi Nguyen
     [not found]           ` <E16yq0k-0003ji-00@giblet>
2002-04-20 11:07             ` Neil Jerram
     [not found]       ` <873cxxkvj8.fsf@zagadka.ping.de>
2002-04-16 20:24         ` Neil Jerram
     [not found]         ` <m3n0w3pf1n.fsf@laruns.ossau.uklinux.net>
2002-04-17  0:53           ` NIIBE Yutaka
2002-04-17  5:36           ` Rob Browning
     [not found]           ` <874riahonj.fsf@raven.i.defaultvalue.org>
2002-04-17  5:43             ` Rob Browning
2002-04-20  7:53             ` Thien-Thi Nguyen
     [not found]             ` <E16ypgs-0003jQ-00@giblet>
2002-04-21 15:20               ` Rob Browning
     [not found]               ` <87ofgdqdr9.fsf@raven.i.defaultvalue.org>
2002-04-21 15:51                 ` Robert A. Uhl
     [not found]                 ` <20020421095106.A31437@4dv.net>
2002-04-21 16:27                   ` Rob Browning
2002-05-14  8:53                 ` Thien-Thi Nguyen
2002-04-23 21:19             ` news
     [not found]           ` <200204170053.g3H0rX008200@mule.m17n.org>
2002-04-20  7:57             ` Thien-Thi Nguyen
2002-04-20  9:06   ` Thien-Thi Nguyen
     [not found]   ` <E16yqp7-0003n6-00@giblet>
     [not found]     ` <m3elhasjez.fsf@laruns.ossau.uklinux.net>
2002-04-20 12:44       ` Thien-Thi Nguyen
2002-04-24  0:09   ` Thien-Thi Nguyen
     [not found]   ` <87ads6nf1v.fsf@zagadka.ping.de>
2002-04-15 17:58     ` Andreas Rottmann
2002-04-24  0:52     ` Thien-Thi Nguyen
     [not found]     ` <87it6s7sjz.fsf@alice.rhinosaur.lan>
2002-04-15 19:06       ` Marius Vollmer
2002-04-24  8:00       ` Thien-Thi Nguyen
     [not found]       ` <E170Hh6-0007Y8-00@giblet>
2002-04-24 14:33         ` Rob Browning
     [not found]         ` <87662hkvya.fsf@raven.i.defaultvalue.org>
2002-04-24 14:51           ` rm
     [not found]           ` <20020424145130.GC17392@www>
2002-04-24 15:14             ` Andreas Rottmann
2002-04-24 15:28             ` Rob Browning
     [not found]             ` <87y9fd5dsj.fsf@alice.rhinosaur.lan>
2002-04-24 15:48               ` Rob Browning
     [not found]               ` <87vgahjdwc.fsf@raven.i.defaultvalue.org>
2002-04-24 16:15                 ` Bill Gribble
2002-04-24 18:06                 ` Andreas Rottmann
     [not found]                 ` <1019664949.936.80.camel@flophouse>
2002-04-24 16:24                   ` Rob Browning
2002-04-24 18:10                   ` Andreas Rottmann
     [not found]                   ` <87ofg955n8.fsf@alice.rhinosaur.lan>
2002-04-24 20:36                     ` Rob Browning
2002-04-25  2:05                       ` Joshua Judson Rosen
     [not found]                       ` <20020425020550.GL29646@linger.twisted-muse.org>
2002-04-25  3:03                         ` Rob Browning
     [not found]                 ` <87sn5l55us.fsf@alice.rhinosaur.lan>
2002-04-24 20:40                   ` Rob Browning
     [not found]                   ` <87sn5khlub.fsf@raven.i.defaultvalue.org>
2002-04-24 20:53                     ` Andreas Rottmann
     [not found]                     ` <0204291926190H.10649@locke.free-expression.org>
2002-04-30  1:35                       ` Thien-Thi Nguyen
     [not found]                       ` <E172MY6-0002fd-00@giblet>
2002-04-30  2:33                         ` Lynn Winebarger
2002-05-04  0:19                           ` Thien-Thi Nguyen
     [not found]             ` <871yd5ktf5.fsf@raven.i.defaultvalue.org>
2002-05-15  0:19               ` Thien-Thi Nguyen
2002-04-24 18:34           ` Thien-Thi Nguyen
     [not found]           ` <E170Rb4-0008B0-00@giblet>
2002-04-24 18:58             ` Rob Browning
     [not found]             ` <873cxkj54j.fsf@raven.i.defaultvalue.org>
2002-04-25  5:32               ` Thien-Thi Nguyen
2002-05-01  5:00           ` Lynn Winebarger
     [not found]           ` <0205010000300Q.10649@locke.free-expression.org>
2002-05-01 13:50             ` Rob Browning
     [not found] ` <878z7rqfrg.fsf@raven.i.defaultvalue.org>
2002-04-14  2:55   ` Rob Browning
2002-04-24  0:24   ` Thien-Thi Nguyen
     [not found]   ` <E170AaI-00070x-00@giblet>
2002-04-24  5:25     ` Rob Browning
     [not found]     ` <87znztllbx.fsf@raven.i.defaultvalue.org>
2002-05-14 10:57       ` Thien-Thi Nguyen
     [not found]       ` <E177a03-0000H2-00@giblet>
2002-05-14 16:11         ` Bill Gribble
     [not found]         ` <1021392674.802.71.camel@flophouse>
2002-05-14 20:54           ` Thien-Thi Nguyen
2002-04-12  1:06 Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='a9cvp8$kks$2@main.gmane.org' \
    --to=neil@ossau.uklinux.net \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=ttn@glug.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).