From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.lisp.guile.devel Subject: Re: Elisp performance Date: Tue, 4 Aug 2009 11:58:56 -0400 Message-ID: References: <4A7045AC.10407@domob.eu> <87ocr1yle9.fsf@arudy.ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249401574 24559 80.91.229.12 (4 Aug 2009 15:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2009 15:59:34 +0000 (UTC) Cc: Daniel Kraft , guile-devel , Neil Jerram To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 04 17:59:27 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 1MYMQA-00071b-Da for guile-devel@m.gmane.org; Tue, 04 Aug 2009 17:59:26 +0200 Original-Received: from localhost ([127.0.0.1]:50021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYMQ9-0005nj-Pm for guile-devel@m.gmane.org; Tue, 04 Aug 2009 11:59:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYMQ3-0005lp-1b for guile-devel@gnu.org; Tue, 04 Aug 2009 11:59:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYMPy-0005lX-MR for guile-devel@gnu.org; Tue, 04 Aug 2009 11:59:18 -0400 Original-Received: from [199.232.76.173] (port=42226 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYMPy-0005lL-J7 for guile-devel@gnu.org; Tue, 04 Aug 2009 11:59:14 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:46312 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MYMPm-0003C8-ML for guile-devel@gnu.org; Tue, 04 Aug 2009 11:59:13 -0400 Original-Received: from [10.0.0.172] (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n74FwuY3029106; Tue, 4 Aug 2009 11:58:56 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.935.3) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:9024 Archived-At: On Aug 4, 2009, at 06:17, Andy Wingo wrote: > Hello! > > (Was away for the weekend, but back hacking all week now.) Welcome back! > On Thu 30 Jul 2009 22:18, Neil Jerram writes: > Daniel Kraft writes: >> >>> Lambda arguments are still always dynamically bound, which is >>> quite a >>> pity as it inhibits tail-call optimization; > Indeed, a pity. Though self-tail calls can be optimized... still, > irritating. In the compiler, or in the byte-code engine? The Emacs byte compiler does not do self-tail call optimizations. Since the function value of a symbol can be copied out and/or replaced (and Emacs ships with the "advice" package which does both), the symbol's function value may wind up not being the function body being compiled; turning a self-tail call into a jump back to the beginning would cause observable behavior changes from what happens now. On the other hand, I haven't looked at what elisp compiles to in Guile; maybe it's possible to have the byte-code engine detect when you're making a tail call to yourself (such as recursive calls when the function value slot hasn't been messed with) and optimize them on the fly? Ken