Hi!

On Thu 24 Jan 2013 14:50, Noah Lavine <noah.b.lav...@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 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.

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.

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 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
:)

Cheers, and happy hacking :)

Andy
-- 
http://wingolog.org/

Reply via email to