This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: boot-9



hjstein@bfr.co.il writes:
> 
> Is all the stuff in boot-9 really necessary?  I've noticed things
> like:
> 
>    (define pk peek)
>    (define (id x) x)
>    (define (and=> value procedure) (and value (procedure value)))
>    (define (apply-to-args args fn) (apply fn args))
>    (define string-character-length string-length)
>    (define (read-line! ...) ...)
>    (define (read-line ...) ...)
>    (begin
>      (define uniform-vector? array?)
>      (define make-uniform-vector dimensions->uniform-array)
>      ...)
> 
> to just point out a handful of things...
> 
> Not to mention all the wrappers stat:*, get*, end*, passwd:*, group:*,
> hostent:*, netent:*, protoent:*, ...  which I would have thought
> should be elsewhere, such as a unix module, or a filesystem module, or
> ...
>      
> It just seems like there's lots of stuff there of questionable value
> which has to be parsed & loaded into every guile session.  I'd suspect
> that over half the file could be eliminated or go elsewhere.
> 
> I thought there was work a long time ago to clean out boot-9.  Am I
> mistaken?  If not, is anyone looking into cleaning this up?
> 

Some of the trivially removable things were removed from boot-9 a
while back, cutting startup time in half. There is still much more
that can be removed from there (as well as from libguile). In
particular, I did an experiment recently with removing all the posix
and networking-related functionality from both libguile and boot-9
that could be removed and still allow Guile to otherwise work. I got
approximately a 10% reduction in the size of libguile, a 10% reduction
of boot-9.scm, and a 10% reduction of runtime size of the `guile'
binary. I have not yet done the work to make the separation more clean
and reasonable, or to get all the posix-related stuff to work as
separate modules, but I am working on it.

I suspcet Jim does not want this stuff before the 1.3 releasee (I
assume the developers want to fix bugs, not introduce potential new
ones), but hopefully, it could be incorporated soon after.

However, many of the seemingly silly things in boot-9 (and in
libguile) are harder to remove. For example, records and
`defmacro'-style macros are both defined in boot-9.scm, and would be
natural candidates for removal and consignment to separate
modules. But they are used to implement the current scheme-code module
system, so they cannot be removed into separate modules. Many of the
other seemingly random things in there are used by the module system
or by things used by the module system, etc, so determining what can
be removed and what can't is a trivial job.

I also thought about trying to remove arrays and hash tables from
libguile, but hash tables are used in the interpreter's internals (and
so the Scheme interface to them may as well stay) and arrays are
somewhat entagled in other bits of seemingly unrelated code.

 - Maciej