unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Native code generation and gcc
Date: Sun, 04 Dec 2016 11:09:54 +0100	[thread overview]
Message-ID: <m2a8ccm2dp.fsf@gmail.com> (raw)
In-Reply-To: <CAA2Xvw+80=6n=CK46xTjCbwQvfu3LqqT_FsU96VoMMPWhu5JJw@mail.gmail.com> (Mikael Djurfeldt's message of "Sat, 3 Dec 2016 15:52:12 +0100")

The following message is a courtesy copy of an article
that has been posted to gmane.lisp.guile.devel as well.

On Sat, Dec 03 2016, Mikael Djurfeldt wrote:

> Are there fundamental reasons for not re-using the gcc backends for
> native code generation? I'm thinking of the (im?)possibility to
> convert the cps to some of the intermediate languages of gcc.

Tail calls come to mind.  GCC is built around the C/C++ ABI and C
calling conventions.  Due to C's varargs, that's almost always some
variant of "caller pops arguments".  I think sibling calls can be
optimized everywhere but not general tail calls.  You could add support
for tail calls to some backends, but that's far from "for free".  The C
calling convention is also not that great for returning a (statically)
unknown number of values.

Sure, there are tricks/kludges to compile Scheme to C.  I think it would
be simpler/less risky to make a C generating backend for Guile before
going directly to GCC.  The main advantage of a direct GCC front-end
would be better control over debugging information.

Helmut



  reply	other threads:[~2016-12-04 10:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAA2XvwKQubnmb4cQXGyP80GjT7_001-xxhFrdP3SKL3+6HkuVw@mail.gmail.com>
     [not found] ` <CAA2XvwJjWigCcRBmk3dNJH4+0bEDTOoyL1=o5qj8JpbhuLm-xw@mail.gmail.com>
     [not found]   ` <CAA2XvwKb9hPUyeOvSZo0fWpDDEzSgjaw_Xehz4rMob1TyNucEA@mail.gmail.com>
     [not found]     ` <CAA2XvwLwPP728sAeV1mNmDVmGe_V0buiT_xgMDMihBqNXX_RgA@mail.gmail.com>
     [not found]       ` <CAA2Xvw+RCs4fMU5Pw6QP8ofWtX0k8EbnpLR5KkYUMvLbgopGZw@mail.gmail.com>
     [not found]         ` <CAA2XvwKRp1KDk285zTH3xLkEhHFcN=_owDf2RFPzt-JnXhxLAg@mail.gmail.com>
     [not found]           ` <CAA2XvwJUFZ-A+9sbNtomOCiCe=CR+WMAuuTdybUjocVgHmMZ-g@mail.gmail.com>
     [not found]             ` <CAA2Xvw+mzfKyfiC44VWrZcHRtwgYRDqci9ZbUgUndNq2HEL6tg@mail.gmail.com>
     [not found]               ` <CAA2XvwJmfmykKXrb+zgoEWs7LrBfWBgjP+jOYvdjT06=WAFfFw@mail.gmail.com>
2016-12-03 14:52                 ` Native code generation and gcc Mikael Djurfeldt
2016-12-04 10:09                   ` Helmut Eller [this message]
2016-12-04 15:17                   ` Greg Troxel
2016-12-05 16:18                   ` Lluís Vilanova
2016-12-11 18:09                     ` Mikael Djurfeldt
2016-12-11 18:31                       ` Stefan Monnier

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=m2a8ccm2dp.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=guile-devel@gnu.org \
    /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).