[racket] phases

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Mar 2 07:36:18 EST 2012

On Fri, Mar 2, 2012 at 4:47 AM, Marijn <hkBst at gentoo.org> wrote:
> One other thing
> that could use some explanation is why racket uses phases in the first
> place, given that other systems (I believe Larceny is the prime
> example) have implemented a phase-less or phase-inferring macro system.

The short answer for this is to control the behavior of side effects
at expansion time.  In the presence of such side effects, correct
phase-inference is impossible in the general case, and even in simpler
cases, behavior changes depending on how the program is compiled.  In
Ikarus (which is where the phase inference work was done), the
designers decided that such macros were not an important use case.

While they are mostly not intended as tutorials, the two papers that
talk about phases: Matthew's 2002 paper, Composable and Compilable
Macros, and Ryan, Matthew and my 2007 paper mentioned earlier in this
thread, provide a useful overview of what can be accomplished with
phases.
-- 
sam th
samth at ccs.neu.edu

Posted on the users mailing list.