Turtle Compiler

From Adam Colton
Revision as of 16:38, 26 September 2019 by Adamcolton (talk | contribs)
Jump to navigation Jump to search

Ok, so I need to finish the Dragon book before I get too far into this.

Micro Pass Compiler

I need several syntaxes that are related. A compiler node operates on one syntax and outputs one syntax (often the same).

This makes it easy to test compiler nodes - run the compiler without the node and run the tests against the output, then re-run the compiler with the node and make sure all the tests still pass. Also it makes it easy to benchmark, same operation.

Top Level Steps

This is standard, but I'm learning so I need notes.

  1. Determine imports graph
  2. lex and parse files to AST
  3. High level AST optimizations
  4. Convert down to mid level AST
  5. Mid level optimizations
  6. Covert down to byte code
  7. Byte code optimizations