From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: rfc: (ice-9 accumulate) Date: Sat, 09 Jan 2010 22:55:58 +0100 Message-ID: References: <873a2fo8wc.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263074165 24708 80.91.229.12 (9 Jan 2010 21:56:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2010 21:56:05 +0000 (UTC) Cc: guile-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 09 22:55:57 2010 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 1NTjHF-0000pg-2D for guile-devel@m.gmane.org; Sat, 09 Jan 2010 22:55:21 +0100 Original-Received: from localhost ([127.0.0.1]:45512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTjHF-0002Ex-OZ for guile-devel@m.gmane.org; Sat, 09 Jan 2010 16:55:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTjHB-0002Dn-Ml for guile-devel@gnu.org; Sat, 09 Jan 2010 16:55:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTjH7-0002A0-0k for guile-devel@gnu.org; Sat, 09 Jan 2010 16:55:17 -0500 Original-Received: from [199.232.76.173] (port=50967 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTjH6-00029s-SY for guile-devel@gnu.org; Sat, 09 Jan 2010 16:55:12 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:58399 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTjH6-0000v4-1q for guile-devel@gnu.org; Sat, 09 Jan 2010 16:55:12 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 835868E686; Sat, 9 Jan 2010 16:55:11 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=MLr1kSiQiwGv/NLbBFNPmD/wgko=; b=mgJYyQ rL/uPVviGRhvdLKJUAEKVqDCFRtYa850EJZ8PXFC/TzPxmxZL00Udv8beo+Rfym3 Lsq4IP7NvoLmU46doJxLhcTEOUK/Hw0sUMagMQ/2qiCPnfZu4zu44uC0w+4niT2+ iS014YWeRZ5TajYQRipHq67cP2t2Djj1b9Iqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ayhPS3JCZY9bfQfBTynEye4HrQEhPaNk dFPc4qeNkJNgE7eNBVXiIb65/uHU0vZQNCWkQoeF3EZDPuLwLdA5NZyrbNWS8LCk bzuLhaT/p1JHB+eRLZrjQSBTorvmTvCMHqqbcfyt8sd4c7/+YnOOL4Uq+90uanvZ NysNbF3EoiE= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 703C78E685; Sat, 9 Jan 2010 16:55:10 -0500 (EST) Original-Received: from unquote (unknown [79.150.127.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 62AAE8E680; Sat, 9 Jan 2010 16:55:08 -0500 (EST) In-Reply-To: <873a2fo8wc.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Sat, 09 Jan 2010 11:44:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: A846C464-FD69-11DE-926E-9D59EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:9843 Archived-At: Greets, On Sat 09 Jan 2010 11:44, Thien-Thi Nguyen writes: > Would there be any interest in adding (ice-9 accumulate) to Guile? > > - > http://www.gnuvola.org/software/guile/doc/Efficient-Accumulation.html Speaking only for myself, I would be unlikely to use it; but OTOH I am not against having it. > I can see several arguments against doing so: You are not selling your idea very well here. But I'm still OK with it :) > - The interface is procedural, possibly defeating compiler optimization. > When i wrote it, it was an exercise for hobbit. The hope was that > hobbit could eventually learn to optimize usage of (ice-9 accumulate) > calls to (strength-, complexity-)reduce them to (ice-9 q) calls, where > other data-oriented optimizations can come into play. Perhaps that > hope was only a non-compiler-geek dream (sounds nice but unfeasible). > Perhaps Andy can either revive this hope or kindly kill it off now? So, here's the deal, as far as I understand inlining... (And your question is about inlining, afaics, in the sense that the Waddell paper treats inlining) (1) Inlining across module boundaries: personally I have no intention of hacking on this, beyond approaches like define-integrable (see the end of http://www.scheme.com/tspl3/syntax.html). The fundamental issue is that our modules are first-class rather than syntactic. Define-integrable allows you to make a step towards the syntactic, a very useful step. (2) Inlining of procedures defined within one file/module: We will probably do this, probably by treating private bindings from a module as being letrec-bound within the module. (3) Inlining of let or letrec-bound procedures: We will do this at some point, and do it fairly well. But, in this case, we still wouldn't be able to inline very well, because it's an side-effecting interface. Once you have side effects, it gets hard to reason about, especially in the presence of continuations -- and you usually don't know when a continuation may be captured. So this particular construct is unlikely to be inlined nicely. However, it's useful to you, and might be useful to someone else. > - There is already something in Guile. [If so, where? Thanks.] There's lots of stuff in ice-9 that noone knows about, but I don't think there's something like this. Hopefully we can document more of it using the new (texinfo reflection) infrastructure. > Of course, the primary argument *for* adding it would be to make porting > my stuff to Guile easier. That's a selfish argument, so take it FWIW. Well, we'd like your energy as well, so selfishness on all sides... Cheers, Andy -- http://wingolog.org/