guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CPS and Guile


From: Noah Lavine
Subject: CPS and Guile
Date: Sat, 18 Feb 2012 11:42:07 -0500

Hello everyone,

There was some discussion in the "Identities in Peval" thread about
using a CPS-like intermediate representation in Guile.

I think that our goal with our intermediate representation should be
to make things convenient for us - we shouldn't try to match any
particular model unless it helps us, and we should be happy
customizing it for ourselves. From this point of view, I see two
orthogonal issues with Tree-IL.

First, some of the tree-il forms have their own control-flow
properties, which doesn't work well with a uniform representation of
control flow. They also complicate the big match statements in peval.
Why not make dynlet, dynwind, dynref, dynset, prompt, and abort into
primitives? Code that cares can still match them, and code that
doesn't care can ignore them.

Second, the idea of annotating tree-il forms with their continuations.
I think that could actually be done fairly simply, if we remove the
contraint that they have to be useful :-). I'm imagining that at first
continuations would be like source information, in that they are
passed everywhere but the compiler doesn't use them. You could even
keep a separate hash table of continuations if you really wanted to,
but that seems like more effort to me.

I think it would be fine to have a hybrid compiler for bit that did
some analyses using the continuation information and some using the
tree-il structure. That might help with the issue of named primitives,
too - we could still generate code from the tree structure.

What do you think?
Noah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]