unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Noah Lavine <noah.b.lavine@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: Native Code Again
Date: Fri, 28 Jan 2011 15:55:09 +0100	[thread overview]
Message-ID: <m362t9dqnm.fsf@unquote.localdomain> (raw)
In-Reply-To: <AANLkTin=9MsKNX=T=1jSF5VJAGMgZh56E+DKG7c=y6_6@mail.gmail.com> (Noah Lavine's message of "Fri, 28 Jan 2011 09:33:33 -0500")

Hi,

On Fri 28 Jan 2011 15:33, Noah Lavine <noah.b.lavine@gmail.com> writes:

>> And also... why not rely on gcc's tail-call optimization, in the case
>> where it works?  You can check for it at configure-time.  I just 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
-- 
http://wingolog.org/



  reply	other threads:[~2011-01-28 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-08 17:27 Native Code Again Noah Lavine
2011-01-28 11:01 ` Andy Wingo
2011-01-28 14:33   ` Noah Lavine
2011-01-28 14:55     ` Andy Wingo [this message]
2011-01-28 16:19     ` Ken Raeburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m362t9dqnm.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=noah.b.lavine@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).