* 5.5 Compilation
5.4 implemented scheme on a register machine

this section shows how to translate a scheme program to register
  machine language

programs written in machine language are sequences of instructions
that use the machine's data paths

compilation translates a given source language into an equivalent
program (object program) written in native machine language

lisps tend to utilize the complimentary benefits of compilation and
interpretation in concert with each other

** 5.5.1 structure of the compiler
the compile procedure is the top-level dispatch in the compiler

similar to the interpreters

compile takes target and linkage as arguments

  - target :: the register in which the compiled code shall return the
              value of the expression
  - linkage :: how the code shall proceed when finished with execution

the code generator returns on instruction soquence containing the
object code it has generated for the expression

smart use of preserving to save and restore registers optimises stack
operations

an instruction sequence is made up of:
  - the registers it needs
  - the registers it modifies
  - its instructions (statements)

** 5.5.2 compiling expressions
here we define linkage for the code generators and its use in simple
expressions, conditional expressions, sequences, lambdas

** 5.5.3 compiling combinations
the essence of compilation is procedure applications

"the code that handles procedure application is the most subtle part
of the compiler"

** 5.5.4 combining instruction sequences
herein are the details for how instruction sequences are represented
and combined. see text.

** 5.5.5 an example of compiled code
see text.

** 5.5.6 lexical addressing
one of the most common compiler optimizations is in variable lookup.

this uses some neat hack that remembers what frame and what order
variables come to speed things up. the compiler can do this with a
data structure called the "compile time environment" which keeps track
of what variables are where, when.

** 5.5.7 interfacing compiled code to the evaluator
they have not yet explained how to load compiled code or how to run
it. well, you hook it into the pre-defined explicit-control-evaluator
machine. 

an interpreter raises the machine to the level of the user;
a compiler lowers the user's program to the machine.

scheme itself is a family of abstractions erected on machine language.

c and c++ programs "lead fast and dangerous lives" because their
compilers do little error checking.

we can compile the compiler itself and use it to compile other lisp
programs.

(fin)

