From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tom Lord Newsgroups: gmane.lisp.guile.devel Subject: Re: goops and memoization Date: Tue, 3 Dec 2002 18:49:59 -0800 (PST) Sender: guile-devel-admin@gnu.org Message-ID: <200212040249.SAA24200@morrowfield.regexps.com> References: <02120219132603.12810@locke.free-expression.org> <200212030838.AAA19360@morrowfield.regexps.com> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1038969578 10429 80.91.224.249 (4 Dec 2002 02:39:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Dec 2002 02:39:38 +0000 (UTC) Cc: djurfeldt@nada.kth.se, owinebar@free-expression.org, dirk@sallust.ida.ing.tu-bs.de, neil@ossau.uklinux.net, guile-devel@gnu.org, djurfeldt@nada.kth.se, djurfeldt@nada.kth.se Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18JPRo-0002i2-00 for ; Wed, 04 Dec 2002 03:39:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18JPSH-0001nX-00; Tue, 03 Dec 2002 21:40:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18JPSD-0001jS-00 for guile-devel@gnu.org; Tue, 03 Dec 2002 21:40:01 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18JPSB-0001hz-00 for guile-devel@gnu.org; Tue, 03 Dec 2002 21:40:00 -0500 Original-Received: from 1cust49.tnt13.sfo8.da.uu.net ([63.10.241.49] helo=morrowfield.regexps.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18JPSA-0001cu-00 for guile-devel@gnu.org; Tue, 03 Dec 2002 21:39:58 -0500 Original-Received: (from lord@localhost) by morrowfield.regexps.com (8.9.1/8.9.1) id SAA24200; Tue, 3 Dec 2002 18:49:59 -0800 (PST) (envelope-from lord@morrowfield.regexps.com) Original-To: djurfeldt@nada.kth.se In-reply-to: (message from Mikael Djurfeldt on Wed, 04 Dec 2002 03:25:51 +0100) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1786 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1786 > Have you considered the approach of writing a custom optimizer (not O, > but another optimizer) that can do a good job of "compiling" (scheme > to scheme): > > > (lambda (ms) (M (O (U ms)))) > > ? Hmm... could you please clarify this suggestion. What is the core idea? To specify O in a custom language and compile it? To optimize the composition of M O and U? Something else that I have missed? O, I am presuming, optimizes method selection, presumbably by ordering tests of argument types in favorable orders and by generating special-case tests where, otherwise, a generic search would be required. Have I missed something? So, O is a fairly straightforward scheme->scheme transform. It can almost certainly be expressed in very regular form (a "custom language" (such as a pattern-matching macro plus quasiquote) -- or simply a narrow Scheme subset). M and U are similar. You can write them as three separate functions, and write a customized optimizer that folds them together. It might even be able to take advantage of non-general optimizations that apply only to these functions. You could look at the custom optimizer as a constant-folding exercise, an abstract-evaluation exercize, or a partial-evaluation exercize (where you are partially evaluating "(apply (compose M O U) free-ms)"). The reason I think this is a plausible approach is just that the three transforms involved (M O and U) don't need to be arbitrary code -- you can do very well here just by thinking of them as pattern-matching rewrite systems -- and such systems compose cleanly and should be easy to optimize. Clearer? or did I just make it worse :-) (I used to suspect that Aubrey secretly generated `eval' using techniques along these lines but eventually concluded: nah, he just writes very consistent code. :-) -t _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel