Frontend/Closure Convert questions...

Daniel Wang danwang@cs.princeton.edu
08 Feb 2000 17:17:49 -0500


First, let say that MLton is a pretty cool piece of software. I was able to
hack at it to get my little toy GC working in it without too much problem at
all. I ran a few benchmarks on some very small input programs and was amazed
to find out that my compiler generated GC was actually faster then the
native C version. This might just be an artifact of the really small
programs benchmark I was using.

In anycase, up until now I've just been using the CPS language as a target
for my own IL. To do some real experiments, I want to reuse the MLton
frontend and try to feed in some real ML programs at my GC and see what
happens. So I'm trying to figure out what's the easiest way to do things. 

I've got three options as I see it.

1. Run ML programs all the way pass closure-convert.fun to get a CPS program
which I feed back into my IL.

2. Hack closure-convert.fun to emit programs in my IL. 

3. Write my own Sxml -> IL closure converter.

I already have a converter from my IL to CPS working. 

   1. Seems the easiest at first but my IL lacks variant types, and doesn't
   decompose case statements in the way the current CPS does. My IL looks
   more like a first order ML source program. 
   
   2. May be easy to do, but I'm not so sure it's not easier to just start
      from scratch. In the longrun I need to treat exception handlers in a
      different way. 

   3. Is what I'm leaning toward, it seems like I can just reuse the
      flow-analysis.sig and it's only a matter of hacking.

I'd love to hear some comments....