From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: CPS and RTL Date: Thu, 24 Jan 2013 23:38:58 -0500 Message-ID: References: <87libjhtk4.fsf@pobox.com> <878v7jnd5m.fsf@tines.lan> <878v7ij2bk.fsf@pobox.com> <87sj5qfwd0.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2e107f7fc04004d415818d X-Trace: ger.gmane.org 1359088748 30164 80.91.229.3 (25 Jan 2013 04:39:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jan 2013 04:39:08 +0000 (UTC) Cc: Andy Wingo , Mark H Weaver , guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 25 05:39:27 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tyb4Y-0000MJ-CT for guile-devel@m.gmane.org; Fri, 25 Jan 2013 05:39:26 +0100 Original-Received: from localhost ([::1]:50937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tyb4G-0004eS-Fy for guile-devel@m.gmane.org; Thu, 24 Jan 2013 23:39:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tyb4C-0004eM-5a for guile-devel@gnu.org; Thu, 24 Jan 2013 23:39:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tyb48-0005wi-6p for guile-devel@gnu.org; Thu, 24 Jan 2013 23:39:04 -0500 Original-Received: from mail-pa0-f44.google.com ([209.85.220.44]:42494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tyb47-0005w1-TS for guile-devel@gnu.org; Thu, 24 Jan 2013 23:39:00 -0500 Original-Received: by mail-pa0-f44.google.com with SMTP id hz11so20015pad.3 for ; Thu, 24 Jan 2013 20:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CsdKmXh7+fpCiVnhW3npn93PhsnXrmqwIDIZItN4+98=; b=B30Uf4biIxTq+nRiklZof31LUFmh7K7aDWXj3K8VAopWIf6w356wHiaJU+IiuioqvU zrgx8Rj+/AFH8GROZcRBknC+UEz3NZGusgrehuCB4eQtANdi7LzD2/Yf+pLX6ZyUe+VM j9JQmrOOf5stTXCUaoKklFZP7TzWdLk5jMurft5+gM2U+K7V24MtrDV1to+0r21PbtK0 LuHsP7AJS/xbEoH9nFzFA/3J0hfA82GNAGCE32nQbicUllDipdEdT9+JiN+xPD7qrXL6 g3I5x7/fXun2dLo5ABpM1A5bKiR0kRMMqXp5ktO1qCnAdvTLbQTsvdtWux0jo6t03o/g Zcyw== X-Received: by 10.68.244.169 with SMTP id xh9mr11200866pbc.52.1359088738877; Thu, 24 Jan 2013 20:38:58 -0800 (PST) Original-Received: by 10.68.242.73 with HTTP; Thu, 24 Jan 2013 20:38:58 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 1Z9pow-LLkx-nfOmmpuJHjWnfV8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.44 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15587 Archived-At: --047d7b2e107f7fc04004d415818d Content-Type: text/plain; charset=ISO-8859-1 The push is complete. If I'm not mistaken, you should now see a wip-rtl-cps branch with a Tree-IL->CPS compiler. The compiler is used in cps.test. Please let me know if I did anything wrong. Noah On Thu, Jan 24, 2013 at 11:03 AM, Noah Lavine wrote: > Hello, > > On Thu, Jan 24, 2013 at 10:12 AM, Andy Wingo wrote: > >> Hi! >> >> On Thu 24 Jan 2013 14:50, Noah Lavine writes: >> >> > Thanks for the review! There has actually been more progress since I >> > pushed that branch. I hit a point in the CPS->RTL stuff where I had >> > trouble because I didn't know how to do things (like mutable variables) >> > in RTL. So I've actually ported the compiler to GLIL in a branch on my >> > computer. I also have a working Tree-IL->CPS compiler for some of >> > Tree-IL (it's not done yet). >> > >> > I thought that might be a better way forward because CPS and RTL are, to >> > a certain extent, separate ideas. >> >> Cool, please push so we can see. >> > > Given the rest of your email, maybe I'll move the Tree-IL->CPS compiler > back to wip-cps-rtl branch and push that. > > >> Honestly I think RTL and CPS go together very well. CPS is all about >> giving a name to everything, but that can be inefficient in a stack VM, >> because referencing and updating named variables requires separate push >> and pop instructions. RTL makes this easy and cheap. >> > > Yes, I hadn't thought about that. RTL does make sense. > > >> Regarding mutable variables: we probably still need to box them in >> general because of call/cc. There are cases in which they can be >> unboxed, but I think that store-to-load forwarding with DCE can probably >> recover many of those cases. Dunno. I would box them as part of an >> assignment conversion pass. >> > > I think I was imagining about the same thing you're thinking. > > >> > I realize it might be confusing to start with CPS->RTL, then switch to >> > CPS->GLIL, then switch back later when the RTL branch is ready. If you'd >> > rather do it that way, we can skip the CPS->GLIL phase. >> >> Personally I would prefer to target RTL. But that is a personal opinion >> :) >> > > I'm happy to! You've convinced me that it's better. I see that you just > implemented toplevel-refs, too, so my problem is solved. > > Best, > Noah > > --047d7b2e107f7fc04004d415818d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The push is complete. If I'm not mistaken, you should = now see a wip-rtl-cps branch with a Tree-IL->CPS compiler. The compiler = is used in cps.test. Please let me know if I did anything wrong.

Noah

=

On Thu, Jan 24, 2013 at 11:03 AM, Noah L= avine <noah.b.lavine@gmail.com> wrote:
Hello,

On Thu, J= an 24, 2013 at 10:12 AM, Andy Wingo <wingo@pobox.com> wrote:
Hi!

On Thu 24 Jan 2013 14:50, Noah Lavine <noah.b.lavine@gmail.com> writes:

> Thanks for the review! There has actually been more progress since I > pushed that branch. I hit a point in the CPS->RTL stuff where I had=
> trouble because I didn't know how to do things (like mutable varia= bles)
> in RTL. So I've actually ported the compiler to GLIL in a branch o= n my
> computer. I also have a working Tree-IL->CPS compiler for some of > Tree-IL (it's not done yet).
>
> I thought that might be a better way forward because CPS and RTL are, = to
> a certain extent, separate ideas.

Cool, please push so we can see.

Given the rest of your email, maybe I'll move the Tree-IL->CPS= compiler back to wip-cps-rtl branch and push that.
=A0
Honestly I think RTL and CPS go together very well. =A0CPS is all about
giving a name to everything, but that can be inefficient in a stack VM,
because referencing and updating named variables requires separate push
and pop instructions. =A0RTL makes this easy and cheap.

Yes, I hadn't thought about that. RTL does make = sense.
=A0
Regarding mutable variables: we probably still need to box them in
general because of call/cc. =A0There are cases in which they can be
unboxed, but I think that store-to-load forwarding with DCE can probably recover many of those cases. =A0Dunno. =A0I would box them as part of an assignment conversion pass.

I think I was imagining about the same thing you're thinking.
=
=A0
> I realize it might be confusing to start with CPS->RTL, then switch= to
> CPS->GLIL, then switch back later when the RTL branch is ready. If = you'd
> rather do it that way, we can skip the CPS->GLIL phase.

Personally I would prefer to target RTL. =A0But that is a personal op= inion
:)

I'm happy to! You've c= onvinced me that it's better. I see that you just implemented toplevel-= refs, too, so my problem is solved.

Best,
Noah


--047d7b2e107f7fc04004d415818d--