Thu May 14 09:50:51 CEST 2009

partial evaluation: functions, not macros

Maybe a key element to make this simpler is to stop thinking of
compositions as macros, but instead look at them as non-reduced

Given a function composition (a b c ...) the goal is to re-order the
operations such that the eager peeophole compiler can produce better
code.  Can this maybe be put into mutual feedback?

I.e. stick with eager evaluation, but allow backtracking to search
through the space of possible reorderings.

So let's fix the stage for now:

  - Peephole optimizer stays what it is.  This works well for manual
    code writing where there is usually "only one thing going on at a
    given time", but is non-optimal in general when independent
    operations that are interleaved.

  - Try to find a way to preprocess.

Maybe it's simplest to get rid of the current control flow compiler
for this.  See it as a side-track of the Forth compiler.