Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Loading of .guile file
Hi!
The .guile file is read when entering the repl, but not before. I suggest
to load this file after all other initializations have taken place,
independent of whether the repl is entered or not.
In my opinion, differences between the different modes in which guile is
run should be brought to a minimum. If a user wants certain things to be
initialized only when entering the repl but not when running as a script,
it should be possible to put the initialization for the repl into a
'enter-repl-hook'. But this is already kind of an advanced feature.
I for example use the .guile file to initialize debug options. But since I
also perform some initialization code before entering the repl, I have to
perform the same initializations in my startup files again. Thus, the
.guile file is currently _not_ useful as a means to setup general guile
preferences, and I think this should be changed.
To reduce the amount of confusion when using guile we should try to
achieve the following points (a modified version of the following was
already posted to bug-guile):
* guile's default behaviour should be the same for repl/scripts. There
is only one aspect which may lead to differences: If the implementation
of the repl requires modules to be loaded that are not necessarily
loaded for executing scripts. But I think this should be the only
exception, it should be reduced to the absolute minimum, and it should
be documented what the differences are.
* guile should start with minimum bindings (even in the repl I sometimes
have time-consuming tasks and would like a minimum overhead.) Currently,
after starting guile, 1421 symbols are defined in the module guile-user.
(There may even be more hidden in other modules.) Among those are posix
bindings, socket bindings, bindings for uniform vectors, none of which I
have ever used up to now. I eliminated the calls to scm_init_net_db and
scm_init_socket from init.c without noticeable effect on my programs.
Eliminating scm_init_unif lead to problems during the execution of
boot-9.scm, although with some more effort it should be possible to make
guile start without support for uniform vectors.
The general problem with providing unnecessary features by default is
that all guile users have to pay for the overhead, although only few
will need these features.
* Users that know that they always want certain features activated can do
so in their .guile (assumed it is executed for repls _and_ scripts). To
allow for customization, an enter-repl-hook should be provided.
Best regards,
Dirk Herrmann
Guile Home |
Main Index |
Thread Index