[Top][All Lists]

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

Re: order of evaluation, letrec-values, and define-values.

From: Mark H Weaver
Subject: Re: order of evaluation, letrec-values, and define-values.
Date: Wed, 03 Jul 2013 14:57:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi Andy,

Andy Wingo <address@hidden> writes:
> Not sure what to do.  The part of me that wants to do aggressive CSE
> wants to transform to a form that fixes order of evaluation, but the
> part of me that wants to be able to shuffle values using the Dybvig
> algorithm wants to do the direct form.  Dunno!

I think the proper solution is to fix order of evaluation somewhere in
the _middle_ of compilation, so that compiler passes can be placed
either before or after the order is fixed.  Then we can have the best of
both worlds.

Some passes, such as fixing-letrec, can benefit greatly from UNspecified
order of evaluation, whereas other passes such as CSE can benefit from a
fixed order of evaluation and CPS form.

Speaking of the fixing-letrec pass, I have a chunk of free time over the
next week during which I intend to dust off my fixing-letrec-reloaded
implementation, and to start generalizing that algorithm to support
'letrec-values', 'letrec*-values', and 'define-values'.

Andy: the reason I bring this up is that it will require the 'letrec'
and 'letrec*' node types to be changed to 'letrec-values' and
'letrec*-values'.  I know you're working on that area of the code now,
so consider this a heads-up.

I suspect that fixing-letrec should be done fairly early in compilation.
This has several advantages, most notably that later passes needn't
understand 'letrec' or 'letrec*' nodes at all.

What do you think?


reply via email to

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