initially tiny, then lc. eventually c-like. ints only, no structs, byte literal strings for external calls to C. ecce no xor, no strings at first. flatten namespace. first statics, then params, tthen full auto locals in procs procs vs fns. caller removes from stack. return address interleaved with data - needed macro option to CALL. got to x86 binary stage before starting blog, time to catch up. note simple versions before making changes. record design decisions. simplify C code for bootstrapping. types - store decl tree, not bitmap like psr. mix ast and codegen - inc etc: ast -> code, not ast->ast as no intermediate-code inc instr. creating an INC could be worse for some archiectures. peepholing code directly is bad. do some pattern matches by hand then suggest but don't do table-driven rewrite rules - that's another valid form of compiler... register spilling versus compiling for a stack machine and caching last pushes in regs. very similar. more a conceptual question. next: codegen via ast. peephole. more store to store. retain safe boundary between ops like in macro scheme pseudo stack, record offsets for esp-indexing compiler generator that does source-level merging of fragments rather than #include. build up exercise solutions in turn. peephole the assembler. build binary ast in the assembler. move to compiler later. See "TODO". compare with gcc, remember most optimisations only if -O2. write up about string rewrite rules as a generic way to create a compiler (a sort of superset of peepholing, slightly more legit) show how some opts can be done either in compiler or in peepholer, eg jump over jump reversal. usually more efficient to do early, save processing the same code twice.