From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Helmut Eller Newsgroups: gmane.lisp.guile.devel Subject: Re: Native code generation and gcc Date: Sun, 04 Dec 2016 11:09:54 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480846220 30755 195.159.176.226 (4 Dec 2016 10:10:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Dec 2016 10:10:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Dec 04 11:10:08 2016 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cDTkG-0006Fi-Hf for guile-devel@m.gmane.org; Sun, 04 Dec 2016 11:10:08 +0100 Original-Received: from localhost ([::1]:33837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDTkK-0001iK-8m for guile-devel@m.gmane.org; Sun, 04 Dec 2016 05:10:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDTkE-0001g6-RW for guile-devel@gnu.org; Sun, 04 Dec 2016 05:10:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDTkB-0001mI-N8 for guile-devel@gnu.org; Sun, 04 Dec 2016 05:10:06 -0500 Original-Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cDTkB-0001m7-Gv for guile-devel@gnu.org; Sun, 04 Dec 2016 05:10:03 -0500 Original-Received: by mail-wm0-x242.google.com with SMTP id m203so9282349wma.3 for ; Sun, 04 Dec 2016 02:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:newsgroups:subject:references:cc:date:message-id:user-agent :cancel-lock:in-reply-to:mime-version:posted-to; bh=yg5gEbLyWminqx1BKXj/jPqnx3NJLy/b93tAYPlcYEQ=; b=rGMf6kxEAJ1TnFWjs8cjIXv/U/7kmunyLA1bZcmP3E4ec9cM3LaTuD9WBXh9bAoZzf U/tRxOhH8tOBOxsNhoHRbsP/dOVWPwJDh1RVvNVae+Dw4NRTt4qn5HndvhPNeRGPpVTx O04LQTnlBlmynKdKeUcfNsc1tQ5N+3ml5NosdTi/7Ci5CPqgHNq85gyQMw1UNaD9Gng7 KzeEFAy7eyl/dio+dTbo1m4qTgKHJ8RhjdXkss0sEYFOvQ++XXQYqC/rcWZyMLe1ux2e 8HsRQ/hOnlwjvZlKa3edQL0OWsChH5pcGdBzH3AXHWJ6UvcMPVfNXY40S5TUMcIXPzaU RCQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:newsgroups:subject:references:cc:date :message-id:user-agent:cancel-lock:in-reply-to:mime-version :posted-to; bh=yg5gEbLyWminqx1BKXj/jPqnx3NJLy/b93tAYPlcYEQ=; b=GIehPiP9qsOl1flxzo0v8fPjzhXKJs8IDG6im3PNELVjKqx1DMziVdYfhhbteAf9fO jSnw410A2uSstefR/yocE4sLLRFYRMspb1dEWKLQwilt+JLPK5ohnOvqf02Cmu79mOjw vybeTzUWnwk6DXfwox7hpa3irbBQj/siosSIAlLKlvo9rMxlUzkO4uHlSYrjV48Ira56 u04UHgJ1FiZEBqa+tktmtSeya1+vp+f0dZQyiOqW/LeDA2O6Ju27fjCA+sOPZTCuBfWX WnWJBK+MiqVyGJoJUd/DHrliWHpLh/JuyM4ANvj4vhmWTC62wOwuJbPm+n5XHUMNQatm 1nFQ== X-Gm-Message-State: AKaTC00XHHDnzFtQsR8px7OB99HElDJJne8hCb0kDYCqrhmgg0r3jvFctpQHMOyxxfgV1w== X-Received: by 10.28.209.7 with SMTP id i7mr4997393wmg.62.1480846201945; Sun, 04 Dec 2016 02:10:01 -0800 (PST) Original-Received: from caladan (dial-181252.pool.broadband44.net. [212.46.181.252]) by smtp.gmail.com with ESMTPSA id b15sm12341432wma.5.2016.12.04.02.10.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Dec 2016 02:10:01 -0800 (PST) Original-Newsgroups: gmane.lisp.guile.devel Cancel-Lock: sha1:np+W6RYPFEywjamSnvEC2qgZ6Eo= In-Reply-To: (Mikael Djurfeldt's message of "Sat, 3 Dec 2016 15:52:12 +0100") Posted-To: gmane.lisp.guile.devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18772 Archived-At: 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