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: Native Code Again Date: Fri, 28 Jan 2011 15:55:09 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296226224 18189 80.91.229.12 (28 Jan 2011 14:50:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 14:50:24 +0000 (UTC) Cc: guile-devel@gnu.org To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 28 15:50:20 2011 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.69) (envelope-from ) id 1PipeV-0006o9-Up for guile-devel@m.gmane.org; Fri, 28 Jan 2011 15:50:20 +0100 Original-Received: from localhost ([127.0.0.1]:41437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PipeV-0002E5-DU for guile-devel@m.gmane.org; Fri, 28 Jan 2011 09:50:19 -0500 Original-Received: from [140.186.70.92] (port=50660 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PipeS-0002D3-Hm for guile-devel@gnu.org; Fri, 28 Jan 2011 09:50:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PipeR-0003pr-1y for guile-devel@gnu.org; Fri, 28 Jan 2011 09:50:16 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:36974 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PipeQ-0003pg-VW for guile-devel@gnu.org; Fri, 28 Jan 2011 09:50:15 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5D89834A2; Fri, 28 Jan 2011 09:51:04 -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:content-transfer-encoding; s=sasl; bh=Y1SiPxqiCuxk xfl+cbMU0bfC9tI=; b=L9Bm60MmM3yphyklwA6qNoB94r6XfjHmYSe4wEIxBwDX Wxq9o2FcWJmmXdrkZUgOsXH8tN0072g4AkgfZs18IX+qDPKdZEwqaSANfo4cX3IA sO8kOV+F/Se5KiNCQ6/C4zzhLgIdwBQXCA65SS+jBXqes9cKhSiCvrF3TICEbso= 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:content-transfer-encoding; q=dns; s=sasl; b=RtKpZz /rdyKV5q0tm1rxPTotsdNYUSlqqjh4o+JgjfFbPQY4r3JiAcnncSNhbEoK2V8/LX WIXvV808KiZKa82BVeKQTjM2CYXZyfixkvd/DQrNTb466IU5WxT+YUnN3iO68q7b v3x4rnnKLsQyJsatXNT9QM3lz9rIP5OpjKqK0= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 49D3B34A1; Fri, 28 Jan 2011 09:51:03 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id A6C4E34A0; Fri, 28 Jan 2011 09:51:01 -0500 (EST) In-Reply-To: (Noah Lavine's message of "Fri, 28 Jan 2011 09:33:33 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 07359B28-2AEE-11E0-85C7-BC4EF3E828EC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:11384 Archived-At: Hi, On Fri 28 Jan 2011 15:33, Noah Lavine writes: >> And also... why not rely on gcc's tail-call optimization, in the case >> where it works? =C2=A0You can check for it at configure-time. =C2=A0I ju= st ran >> some small tests for tail-calls between functions in separate >> compilation units and it shows that indeed, gcc does the right thing. > > I don't think you want to rely on that, because then programs might > break at -O0 that would work fine at higher optimization levels. You can always test that the compiler supports -foptimize-sibling-calls, and add it to CFLAGS as necessary. In any case you know at configure time whether it is supported or not, and can compile accordingly. > However, if GCC added a special intrinsic function that would always > do a tail call, then that could work. And they might very well add it > if we asked them to. Even if they did, we'd have to check for it anyway. Besides, the idiom already exists: return foo (...);. > Well, the JIT library can already tail-call C code. Great. Cool. The plans coalesce :) A --=20 http://wingolog.org/