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 11:03:43 -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=047d7b33d94e7a29ee04d40af497 X-Trace: ger.gmane.org 1359043438 18152 80.91.229.3 (24 Jan 2013 16:03:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Jan 2013 16:03:58 +0000 (UTC) Cc: Mark H Weaver , guile-devel To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 24 17:04:17 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 1TyPHk-0006Fl-6A for guile-devel@m.gmane.org; Thu, 24 Jan 2013 17:04:16 +0100 Original-Received: from localhost ([::1]:47607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyPHS-00007w-Sp for guile-devel@m.gmane.org; Thu, 24 Jan 2013 11:03:58 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyPHK-00006s-63 for guile-devel@gnu.org; Thu, 24 Jan 2013 11:03:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyPHE-0005UW-Cq for guile-devel@gnu.org; Thu, 24 Jan 2013 11:03:50 -0500 Original-Received: from mail-pa0-f47.google.com ([209.85.220.47]:45311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyPHE-0005UP-4b for guile-devel@gnu.org; Thu, 24 Jan 2013 11:03:44 -0500 Original-Received: by mail-pa0-f47.google.com with SMTP id fa10so5588018pad.6 for ; Thu, 24 Jan 2013 08:03:43 -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=xsX+BCIqr+fDz+4O7toki2hJL7rp0VhDmHKAh923qjU=; b=p/4LedeXGiz4YHPviPS7wlxeBj/dt6Gfrfl/6LriSIhh2uCG55Ah3bfZAvW/KIN0Im 96kAobrGvCAO0aF0GGpPa11FU1FtH9R4qVLICg6uGpjPi2174FaTTjhxmrF/0V3zOhou +WlpRq9E48mEgl/6mXPmcVRAXur0PKPwAkk1TfPfkZJJHu4GGNYFXJGCDw6yJMwZWpoc CXepqvSXQvhZ8SsrDjxXT8P9j2PjYiRFB7bp3GMAB5v8ylE/fdSDkv9ZGr8al64TJeZF R4pwKvPYO9FQAQAma5rxtNm8MzBjiA+t8e/vZHxPruIIBFl6F4NqSE7x7Rv7x0A0iajw BSDQ== X-Received: by 10.68.236.97 with SMTP id ut1mr5983155pbc.164.1359043423250; Thu, 24 Jan 2013 08:03:43 -0800 (PST) Original-Received: by 10.68.242.73 with HTTP; Thu, 24 Jan 2013 08:03:43 -0800 (PST) In-Reply-To: <87sj5qfwd0.fsf@pobox.com> X-Google-Sender-Auth: AbxRYGq6UTHOrX-f-kvm28T1k5c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.47 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:15582 Archived-At: --047d7b33d94e7a29ee04d40af497 Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b33d94e7a29ee04d40af497 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

On Thu, Jan 24, 2013 at 10:12 AM, Andy Wingo <wingo@pobox.c= om> 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 compi= ler 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 thinki= ng.
=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 convinc= ed me that it's better. I see that you just implemented toplevel-refs, = too, so my problem is solved.

Best,
Noah

--047d7b33d94e7a29ee04d40af497--