guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Guile junk drawer and a C plea


From: Maxim Cournoyer
Subject: Re: The Guile junk drawer and a C plea
Date: Sun, 30 Jun 2024 22:55:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Hi David,

"Thompson, David" <dthompson2@worcester.edu> writes:

> Hi Richard and all other Guilers, too,
>
> What follows is not code review, but your patch felt like an
> opportunity to provide some commentary about the trajectory of Guile
> development that I've wanted to share for awhile.
>
> First, I think Guile's default environment is a total mess.  It's the
> very definition of a junk drawer.  There's over 1000 names in the
> (guile) module!  Contrast this with R7RS-small's (scheme base) module
> that only has 200ish.  Guile is an old project and I'm sure stuff just
> accumulated over the years, but having so much in the default
> environment makes it hard to know what a program actually uses because
> many things that ought to be explicit imports are not. This makes it a
> challenge to move Guile in a more "least authority" direction.  As a
> rule, I think Guile should *not* add any additional names to the
> default environment without an extremely good reason. Because (guile)
> is imported implicitly, new names can cause clashes with existing code
> that require #:replace to suppress the warning about shadowing core
> bindings.  For example, the newish 'spawn' procedure collides with
> 'spawn' in (goblins core) in the Goblins project.  I think Guile needs
> a (multi-year, multi-major version) plan to deprecate cruft and move
> the good stuff into different modules.  Give a hoot, don't pollute
> (the default environment)!

You probably know this, but in case you or others don't, you can have a
clean, explicit environment by writing a R7RS-small compatible library
via 'define-library' in a .sld file.  I think that's a good standard and
portable way to resolve the messy default environment situation, which
we should embrace more.  On a related note, I have some patches
improving R7RS support in Guile on the tracker/mailing list, such as
#71304, which allowed me to import R7RS SRFI implementations as-is.

-- 
Thanks,
Maxim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]