From: Julian Graham <joolean@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: r6rs libraries
Date: Sun, 25 Jan 2009 19:27:46 -0500 [thread overview]
Message-ID: <2bc5f8210901251627t5d59f9fg5bc5dcceaf2a0b9f@mail.gmail.com> (raw)
In-Reply-To: <877i4z89jy.fsf@gnu.org>
Hi everyone,
(Switching this conversation to guile-devel from guile-user, since it
seems more appropriate to this list...)
Alright, so I've been studying the van Tonder and Dybvig-Ghuloum
implementations and banging my head against chapter 7 of R6RS, all
with an eye towards mapping them onto Guile's module system, and I
can't for the life of me figure out why the existing implementations
are as complicated as they are. Maybe some more advanced Schemers
than I can shed some light on the following:
* Import and export levels seem to be a fancy way of notifying the
library system of the time at which a library needs to be
loaded/evaluated -- that is, if you import something from [library
foo] for the "expand phase" of [library bar] you've got to evaluate
(i.e., convert to a Guile module) the S-exp for [library foo] before
you can evaluate the S-exp for [library bar]. The levels system is
simply a numerical way of encapsulating this information, but the
proper order of evaluation can also be inferred by inspecting the
import- and export-specs of the libraries being loaded -- i.e., if the
header of [library bar] specifies an import of anything from [library
foo], no matter at what "level," it's a safe move to evaluate [library
foo] (if you haven't already done so) before finishing the evaluation
of [library bar]. Is that right?
* R6RS says that a library's imports need to be visited/instantiated
at the time the bindings they export are "referenced." Why? As
above, why can't they be visited/instantiated at the time the imports
for the importing library are processed? Is there any noticeable
difference to the user? Or do you guys read R6RS 7.2 to mean that the
side-effects of top-level expressions absolutely need to happen at a
time determined by the import level?
* R6RS also says that implementations are free to visit/instantiate
libraries more or less often than is required by the import-export
graph. Why would you want to visit/instantiate a library more than
once? Why not just do it once, turn it into a module, and cache it?
Andy Wingo noted that some implementations do a fresh visit for every
phase (and that it's problematic), but I can't even see why you'd want
to if the spec lets you off the hook for it.
I understand that the authors of the reference implementation
re-created a lot of machinery out of whole cloth since they were
avoiding assumptions about features of their target Scheme platforms,
but, man, both van Tonder and Dybvig-Ghuloum look like overkill for
Guile. Am I missing a major piece of understanding here?
Regards,
Julian
next parent reply other threads:[~2009-01-26 0:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2bc5f8210812271705h3f57cb29w5bb83cb02abe971@mail.gmail.com>
[not found] ` <m3k59ktv2g.fsf@pobox.com>
[not found] ` <2bc5f8210812282238p1f91f352id7eca5280dc9ff6a@mail.gmail.com>
[not found] ` <2bc5f8210901012010g2ebb6effx5c966d0e26fe382b@mail.gmail.com>
[not found] ` <8763kt48zi.fsf@gnu.org>
[not found] ` <m3iqosrcn7.fsf@pobox.com>
[not found] ` <2bc5f8210901111521i1a5ec85em65ee20135cc55ebb@mail.gmail.com>
[not found] ` <877i4z89jy.fsf@gnu.org>
2009-01-26 0:27 ` Julian Graham [this message]
2009-01-27 10:51 ` r6rs libraries Andy Wingo
2009-01-27 20:09 ` Ludovic Courtès
2009-01-28 17:26 ` Julian Graham
2009-02-16 18:35 ` Julian Graham
2009-02-16 20:58 ` Andreas Rottmann
2009-02-18 6:08 ` Julian Graham
2009-02-18 14:27 ` Andreas Rottmann
2009-02-17 21:43 ` Ludovic Courtès
2009-02-18 5:37 ` Julian Graham
2009-02-18 8:53 ` Ludovic Courtès
2009-02-18 21:16 ` Andy Wingo
2009-03-04 5:23 ` Julian Graham
2009-03-04 8:39 ` Ludovic Courtès
2009-03-04 22:51 ` Julian Graham
2009-03-06 23:39 ` Ludovic Courtès
2009-03-07 0:43 ` Julian Graham
2009-03-22 22:30 ` Julian Graham
2007-02-06 15:55 R6RS Libraries Ludovic Courtès
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=2bc5f8210901251627t5d59f9fg5bc5dcceaf2a0b9f@mail.gmail.com \
--to=joolean@gmail.com \
--cc=guile-devel@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).