Fri Mar 5 08:32:16 CET 2010

Assembler expression language

The reason this is so difficult is because this mixes a lot of

  - binding: all expressions are valid in an environment of labels.
    i.e. it is a reader monad.

  - the expressions themselves should be compilable to external
    assembler expression trees or embedded in Scheme

  - the syntax of the expression language can be concatenative or
    nested expressions.  maybe it's best to stick to the latter,
    because they have "value" semantics, not stack semantics.

  - this can be unified by allowing a lifting procedure that lifts
    relevant scheme procedures to procedures over an extended abstract
    domain.  I.e. + can mean scat/+ or scat-abstract/+ which delegates
    to scat/+ in case of literals.

So essentially:

   A an assembly object is a collection of _undefined_ labels (an
     environment) and a collection of expressions in terms of those

   M machine code is a collection of _defined_ labels containing
     binary code objects.

To be able to use internal and external assembler, the function A -> M
needs to be abstracted.