[racket-dev] Experiments with closure conversion

From: J. Ian Johnson (ianj at ccs.neu.edu)
Date: Wed Nov 21 11:56:11 EST 2012

I have a control-flow analysis of a subset of Racket that is similar to R4RS Scheme (only with immutability in the right places). In fact, I have many - in order to compare different analyses' effectiveness and precision, I have a series of post-hoc analyses and program transformations I want to do.

One is lightweight closure conversion (Wand & Steckler 1996)

Is a source->source transform that uses immutable vectors for passed environments and unsafe references for variable lookups enough to get the Racket compiler to pick up on what I'm doing?
I'm really not quite sure which question to ask, since I haven't made my own higher-order language compiler top to bottom before, and don't know if there might be internal represenations that I'd need to use rather than user-level representations.

Thanks,
-Ian

Posted on the dev mailing list.