Mon Jun 25 15:18:13 CEST 2007
vm words and literals
so, looking at the remarks before.. the literal stack is really more
than just literals. it could contain words to. words in their normal
meaning are calls.
so: the assembler buffer is just a stack of symbols, bound to
semantics (literal, call, jump). what i really need is 2 new opcodes:
lit and word, that will be resolved in the assembler, but that can be
used in the optimizer and partial evaluator without too much trouble.
so i think i see the roadmap now:
1. fix assembler to take these opcodes:
cw call word (code)
jw jump word
qw quote word (data)
which are really just the primitives used in the VM
2. fix the peephole optimizer to operate on those words
this will give a proper semantics to the literal stack, basicly it
will then contain words + their meaning: code or data. again a simple
pattern: delay low level representation as long as possible.
now i need to check first if the monitor code still runs..
it does. time to fix this.
it's probably easiest to create an extra assembly step which filters
out the pseudo ops. could be interesting to clean up the assembler a
i'm writing pic18-compile-post now, and will start using 'values' to
do the expansion. at first i though this values thing was a bit
clumsy, but having to wrap things in a list is usually more work: it's
better to do this in the consumer using call-with-values, than in the
producer when there are a lot more producers than consumers. which is
the case here..