End Notes

coding
We are passing the power function, but cogen needs to explicitly manipulate some coded representation of the procedure. I handle this by extending the run time representation of functions with their IR source.
compilation
What is compilation anyway? There are bytecode compilers, compilers to threaded code, naive compilers to native code, and seriously optimizing compilers.
direct-multistage
The hard part of a directly implemented multistage compiler generator appears to be lifting. Something like the lift compiler may be a good way to address this.
emacs-languages-all
more sublanguages in emacs: printf format language, documentation string language, interactive argument prompt language...
higher-order-cruft
Note this makes lifting non-transitive. Say instead you had lifted twice:
    (cons (const cd) (cons ...) _ #t) -->
    (cons D (cons ...) _ #t) --> D
    
In this case the information is lost. This is a potential source of brittleness, though I can't imagine how it could happen.

If you were also to handle the

    (cons (const cd) (cons ...) _ #t) -> (cons S D)
    
case, then the car could be S instead of D. Is this useful?
lift-compiler-cruft
The lift compiler is not solid yet; some cruft remains in its implementation (and thus in my understanding of the situation). Since this is an inductive definition of lift, when we are cogening it, we must not need to lift (or if we do it must be somehow simpler, leading to termination. But really, I think its best to avoid it entirely). This is the source of the lift-if-circular hints. Furthermore the cons in the recursive case should be marked as non-collapsing (haven't really confirmed this last one yet, and there's no mechanism for that kind of hint either (though they sure are easy to add)). Once this is working for sure, then I'll explain it it more detail. More importantly, this all should change for the simpler when real BTA becomes available.
match
Andrew Wright's match macro performs pattern matching and destructuring. It's documentation is available here. I recommend it.
meta-static
It's called meta-static analysis instead of just static analysis to avoid confusion with static values, which don't arrive until the compiler is executed.
name
Nitrous oxide (N_2O) makes racing cars go fast, see here. Also here for a different perspective.
removing-times-one
this compiler produces an unnecessary multiplication by 1.0, not present in the hand coded power-20. It can either be removed by the backend (here backend means either the lisp compiler or DCG), or an optimizing interpreter can be used (an interpreter that avoided the multiplication with an additional case).
run-time
What is `run time' anyway? It's generally a contrasting term with `compile time'. The distinction is just an artifact of the barriers put up by the operating system and `convention'. (Compare the price of calling a procedure on a buffer and running a process on a file.) The whole point is to reduce the barrier to getting at that compiler.
self-app-mutation
The side-effects used in cogen's memo-tables are exactly what interferes with a return to self-application (see future). [Heintze94] suggests side-effects can be handled. Since memo-tables are relatively well-behaved mutations, I expect a nice solution is possible.
shade-power
If the surface and the light are both white, and the eye and the light are exactly lined up, then the shading procedure reduces to an power procedure. It's a generalization of b^e in the same way that cb^e is.
typed-interpreters
One could recognize when a particular variable has function type, but if procedures are used to represent procedures, as one has to in order for all this to work, then this is equivalent to saying that the programs run by the interpreter don't have type errors. That would amount to a proof that the implementation of the interpreter's (hypothetical) type checker is correct, and this is practically out of reach for now, though conceivable with hand annotation to guide the proof.

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

duck

goose