From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: order of evaluation, letrec-values, and define-values. Date: Wed, 03 Jul 2013 14:57:34 -0400 Message-ID: <874ncbfp41.fsf@tines.lan> References: <87li6959oz.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372878011 22533 80.91.229.3 (3 Jul 2013 19:00:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2013 19:00:11 +0000 (UTC) Cc: guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jul 03 21:00:11 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UuSHj-0000Rq-NE for guile-devel@m.gmane.org; Wed, 03 Jul 2013 21:00:11 +0200 Original-Received: from localhost ([::1]:36417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSHj-0004MW-Dl for guile-devel@m.gmane.org; Wed, 03 Jul 2013 15:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSHQ-0004Av-6B for guile-devel@gnu.org; Wed, 03 Jul 2013 14:59:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuSHP-0001Rk-5h for guile-devel@gnu.org; Wed, 03 Jul 2013 14:59:52 -0400 Original-Received: from world.peace.net ([96.39.62.75]:34237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSFS-0000lw-FW for guile-devel@gnu.org; Wed, 03 Jul 2013 14:57:50 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UuSFL-0002eS-4e; Wed, 03 Jul 2013 14:57:43 -0400 In-Reply-To: <87li6959oz.fsf@pobox.com> (Andy Wingo's message of "Mon, 17 Jun 2013 12:10:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16511 Archived-At: Hi Andy, Andy Wingo writes: > Not sure what to do. The part of me that wants to do aggressive CSE > wants to transform to a form that fixes order of evaluation, but the > part of me that wants to be able to shuffle values using the Dybvig > algorithm wants to do the direct form. Dunno! I think the proper solution is to fix order of evaluation somewhere in the _middle_ of compilation, so that compiler passes can be placed either before or after the order is fixed. Then we can have the best of both worlds. Some passes, such as fixing-letrec, can benefit greatly from UNspecified order of evaluation, whereas other passes such as CSE can benefit from a fixed order of evaluation and CPS form. Speaking of the fixing-letrec pass, I have a chunk of free time over the next week during which I intend to dust off my fixing-letrec-reloaded implementation, and to start generalizing that algorithm to support 'letrec-values', 'letrec*-values', and 'define-values'. Andy: the reason I bring this up is that it will require the 'letrec' and 'letrec*' node types to be changed to 'letrec-values' and 'letrec*-values'. I know you're working on that area of the code now, so consider this a heads-up. I suspect that fixing-letrec should be done fairly early in compilation. This has several advantages, most notably that later passes needn't understand 'letrec' or 'letrec*' nodes at all. What do you think? Mark