From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julian Graham Newsgroups: gmane.lisp.guile.devel Subject: Re: r6rs libraries Date: Sun, 25 Jan 2009 19:27:46 -0500 Message-ID: <2bc5f8210901251627t5d59f9fg5bc5dcceaf2a0b9f@mail.gmail.com> References: <2bc5f8210812271705h3f57cb29w5bb83cb02abe971@mail.gmail.com> <2bc5f8210812282238p1f91f352id7eca5280dc9ff6a@mail.gmail.com> <2bc5f8210901012010g2ebb6effx5c966d0e26fe382b@mail.gmail.com> <8763kt48zi.fsf@gnu.org> <2bc5f8210901111521i1a5ec85em65ee20135cc55ebb@mail.gmail.com> <877i4z89jy.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232929678 32022 80.91.229.12 (26 Jan 2009 00:27:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2009 00:27:58 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 26 01:29:12 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LRFLi-0004mN-L6 for guile-devel@m.gmane.org; Mon, 26 Jan 2009 01:29:10 +0100 Original-Received: from localhost ([127.0.0.1]:42404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRFKQ-0002mc-Ux for guile-devel@m.gmane.org; Sun, 25 Jan 2009 19:27:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRFKN-0002ll-Vy for guile-devel@gnu.org; Sun, 25 Jan 2009 19:27:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRFKN-0002lN-Gx for guile-devel@gnu.org; Sun, 25 Jan 2009 19:27:47 -0500 Original-Received: from [199.232.76.173] (port=38593 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRFKN-0002lK-C6 for guile-devel@gnu.org; Sun, 25 Jan 2009 19:27:47 -0500 Original-Received: from mail-gx0-f20.google.com ([209.85.217.20]:54611) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRFKN-0001wM-2i for guile-devel@gnu.org; Sun, 25 Jan 2009 19:27:47 -0500 Original-Received: by gxk13 with SMTP id 13so5022290gxk.18 for ; Sun, 25 Jan 2009 16:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=eZz+buXTLrTWL85kVOkPWcS97bB6Hayt9MXrdDcOcRA=; b=Wl+wniZdZcxClCVpGTpBF7VZUoEuNPkbHU/LfMKS5PIyBusehyJshDXVGFwsv1/ZqM kq2XttJ2AlwzToek7MMnVChynzDKJF3Vpq6jeW5Qf2yNF0B8tImGAMK7pUXDz265Bkfx 1DXIoQqdG2x5sArw9b7ML5pdDFwiLzBa0yfq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KnEDDV16MZ8itqsk2qVwmLhYZtxFtUtRLAPMFLfUBfNLQVes/LromPEX8rq//mFiuI LXJR2rkVzA/hBdPQtAXYMZP7wfpMrdgvrX5B04wFRTKQvGJpPmW14PidXs0uen1Lb+kU kFy3QOUb5WwzbQqqSRhXaumaBbyraODJR1Jh4= Original-Received: by 10.150.230.8 with SMTP id c8mr1042978ybh.10.1232929666428; Sun, 25 Jan 2009 16:27:46 -0800 (PST) In-Reply-To: <877i4z89jy.fsf@gnu.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8074 Archived-At: 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