From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Modified load-path proposal Date: Tue, 13 Dec 2005 09:38:19 +0100 Organization: LAAS-CNRS Message-ID: <87irttpf2c.fsf@laas.fr> References: <878xwx5ld2.fsf@ossau.uklinux.net> <87u0fl3wam.fsf@ossau.uklinux.net> <87oe5s51l4.fsf@ivanova.rotty.yi.org> <87ek6njah0.fsf@ossau.uklinux.net> <87r7adf8h1.fsf@zip.com.au> <87vezhbknv.fsf@ossau.uklinux.net> <87u0ey3mph.fsf@ossau.uklinux.net> <873bmf4ey4.fsf@laas.fr> <87y832l4af.fsf@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1134463147 32472 80.91.229.2 (13 Dec 2005 08:39:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2005 08:39:07 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 13 09:38:59 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Em5gK-0007PI-Jp for guile-user@m.gmane.org; Tue, 13 Dec 2005 09:38:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Em5gq-000055-Mm for guile-user@m.gmane.org; Tue, 13 Dec 2005 03:39:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Em5gl-00004x-Pl for guile-user@gnu.org; Tue, 13 Dec 2005 03:39:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Em5gl-0008WO-4h for guile-user@gnu.org; Tue, 13 Dec 2005 03:39:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Em5gk-0008WL-V5 for guile-user@gnu.org; Tue, 13 Dec 2005 03:39:11 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Em5ic-0005wI-Ea for guile-user@gnu.org; Tue, 13 Dec 2005 03:41:06 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id jBD8cTfK003840; Tue, 13 Dec 2005 09:38:34 +0100 (CET) Original-To: Neil Jerram X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 23 Frimaire an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Neil Jerram , guile-user@gnu.org In-Reply-To: <87y832l4af.fsf@ossau.uklinux.net> (Neil Jerram's message of "Sat, 03 Dec 2005 13:05:12 +0000") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:4986 Archived-At: Hi Neil, Sorry for the delay in answering your proposal. Neil Jerram writes: > I think this rules out any kind of iteration through a .d directory > from init.scm. Apologies for not seeing this consideration before. Agreed. Guile already takes almost two seconds to start up on my 500 MHz G4... > -- Scheme Procedure: initialize-packages . package-names > Load the startup file for each of the packages in PACKAGE-NAMES. > The startup file for a given package is only loaded once per > Guile run, so `initialize-packages' avoids loading a package's > startup file again if it has already been loaded. > If one of the named packages doesn't have a startup file, > `initialize-packages' calls `package-startup-file-not-found' > with the package name as the only argument. By default > `package-startup-file-not-found' prints a warning to standard > output, but you can `set!' it to something else if that is > more appropriate for your application. > > The idea would be for both Guile applications and Guile modules to use > this. A Guile application should know which packages it uses > (directly), and so can include an appropriate `initialize-packages' > call in its startup script. Similarly a Guile module knows which > packages it uses, and so can call `initialize-packages' before trying > to use any modules from that package. > > (In practice this would mean before the define-module form, but I > don't see anything wrong with that. For example: > > (initialize-packages "guile-gtk") > > (define-module (ossau widgets) > #:use-module (gtk gtk) > ...) > > ) Hmm, I don't like it a lot, I find it way too intrusive. And this may also have a slight impact on startup time. Maybe we could instead go for an ad hoc solution. For instance, have Guile provide a `guile-setup' program which could be used as follows: $ guile-setup add-load-path "/usr/chbouib/guile/" $ guile-setup remove-load-path "/usr/local/share/guile/smurf" In practice, this would modify a single (text) file, say, `$data/load-paths.cfg'. This very file would be loaded when Guile is started, modifying `%load-path' accordingly. Autoconf macros would make sure that `guile-setup add-load-path' is called upon installation of a Guile package. For efficiency reason, this file should be text-only (e.g., one load path per line), or it could be more Scheme-friendly (e.g., a sequence of RnRS strings which may be read by `read'). It should not require any call to `eval'. What do you think? This is certainly not perfect but I think we must strive (i) to keep things simple and (ii) to avoid wasting more cycles. Thanks, Ludovic. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user