|
From: | Noah Lavine |
Subject: | Re: CPS and RTL |
Date: | Thu, 24 Jan 2013 23:38:58 -0500 |
Hello,On Thu, Jan 24, 2013 at 10:12 AM, Andy Wingo <address@hidden> wrote:
Hi!
Cool, please push so we can see.
On Thu 24 Jan 2013 14:50, Noah Lavine <address@hidden> 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.
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 toPersonally I would prefer to target RTL. But that is a personal opinion
> 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.
:)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
[Prev in Thread] | Current Thread | [Next in Thread] |