unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludovic.courtes@laas.fr (Ludovic Courtès)
Cc: Guile Users <guile-user@gnu.org>
Subject: Re: Another load path idea
Date: Thu, 19 Jan 2006 10:21:25 +0100	[thread overview]
Message-ID: <87psmobmju.fsf@laas.fr> (raw)
In-Reply-To: <87mzi1jq8j.fsf@ossau.uklinux.net> (Neil Jerram's message of "Thu, 12 Jan 2006 17:44:12 +0000")

Hi,

Neil Jerram <neil@ossau.uklinux.net> writes:

> Well, in the big picture of Guile package development, both of these
> concepts could be useful.  If I'm understanding you correctly, I would
> make the analogies that
>
> - a .la file is a bit like a formal list of all a package's
>   dependencies (which in practice might have to be declared by the
>   package author, or could be detected automatically by code analysis)
>
> - ld.so.conf is the environment information needed to be able to load
>   all those dependencies, which is distilled from the .la file.

Right.

> I'm imagining that the distillation process may take some time - in
> the worst case, for example, it could require searching the whole file
> system - and so it makes sense to do it once at package installation
> time and cache the ld.so.conf-like results.  I'm currently thinking of
> those results as just %load-path components, but they could (and
> probably should) be extended in future to cover LD_LIBRARY_PATH and/or
> the LTDL search path, for loading .so's.
>
> Overall, therefore, I'd say this idea is more about the ld.so.conf
> than about the .la files.  Perhaps with this expanded explanation
> you'd now agree?

I don't see `.la' files as a cache of `ld.so.conf'.  Libtool's `.la'
files are only used at compile-time, in order to find out library
dependencies, while `ld.so.conf' is used to locate dynamic libraries at
run-time, in a way similar to `%load-path'.

A dependency cache in Guile would make it possible to bypass
`%load-path'.  I.e., instead of `(load-from-path "some-file.scm")',
which needs to go through `%load-path', it would allow the right file to
be directly loaded as in `(load "/some/path/some-file.scm")'.  IOW, this
would be an /optimization/.

Personally, I don't think this optimization is worth it (more below).

> Those are both true, but in my mind (at least) there was one more
> factor, namely that it is not neat for every Guile application to
> start up with a load path that covers all installed Guile packages.
> It feels neater to me if each Guile application runs with exactly the
> environment that it needs.

You gave several good arguments against try to minimize `%load-path'.

In fact, I think that the optimization that consists of
minimizing/bypassing `%load-path' is not very valuable:

1. Practically, it seems that traversing even tens of directories to
   locate a file is cheap compared to actually evaluating code, and, for
   instance, marking and sweeping;  ;-)

2. Just like `$PATH', `$LD_LIBRARY_PATH' and the likes, `%load-path'
   should is not supposed to contain a lot of directories; currently, it
   contains 4 items by default, and I guess people will rarely have more
   than 10 items in it.

   For the record, in Debian, most (if not all) Python packages get
   installed in `/usr/lib/pythonX.X' and
   `/usr/lib/pythonX.X/site-packages'.  The same goes for Perl, etc.


As a conclusion, I'd still be in favor of a single file like this:

>> Or what about a single init file (again without any code, only data),
>> somewhat enhanced to keep track of which package rely on a each
>> particular load path:
>>
>>   ((guile-gnome . "/opt/guile-gnome/")
>>    (guile-chbouib . "/usr/local/share/guile-chbouib")
>>    ... )

At startup-time, Guile would simply:

  (set! %load-path
        (append (map cdr (with-input-from-file "config.scm" read))
                %load-path))

Actually, it's likely that several packages will rely on the same load
path, the format should rather be:

    (((guile-gnome) . "/opt/guile-gnome")
     ((guile-chbouib guile-foo guile-bar) . "/usr/local/share/guile")
     ... )

Then, we need a `guile-update-load-path' script that does the right
thing with this file at (un)installation-time.

Thanks,
Ludovic.


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


  reply	other threads:[~2006-01-19  9:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-07 13:42 Another load path idea Neil Jerram
2006-01-12  9:38 ` Ludovic Courtès
2006-01-12 17:44   ` Neil Jerram
2006-01-19  9:21     ` Ludovic Courtès [this message]
2006-01-20 21:21       ` Kevin Ryde
2006-01-21  9:01       ` Neil Jerram
2006-01-22 15:38         ` Andy Wingo
2006-01-26  0:55           ` Kevin Ryde
2006-01-26  8:39             ` Ludovic Courtès
2006-01-26 20:19           ` Neil Jerram
2006-01-26 23:00             ` Kevin Ryde
2006-01-27  8:57               ` Ludovic Courtès
2006-01-28  0:39                 ` Kevin Ryde
2006-01-30  9:11                   ` Ludovic Courtès
2006-02-04 16:44                     ` Neil Jerram
2006-01-29 22:39               ` Greg Troxel
2006-01-31 20:23                 ` Kevin Ryde
2006-01-31 20:58                   ` Greg Troxel
2006-01-23  8:27         ` Ludovic Courtès
2006-01-23 20:04           ` Neil Jerram

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=87psmobmju.fsf@laas.fr \
    --to=ludovic.courtes@laas.fr \
    --cc=guile-user@gnu.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).