Need another parsing stage
February 6, 2011
Posted by on
Another parsing stage is required just after the front-end bytecode and before anything else. This is where duplicate subgraphs in the execution trace are identified using a memo. This is generally useful for both interpreting and kernel assembly. The interpreter avoids recalculating results using the memo as it recursively traverses the execution trace. In a similar fashion, kernel assembly avoids duplicated reductions.
The current design goes directly from stack machine bytecode to the interpreter and JIT. While this keeps the front-end simple, it also forces syntactical analysis (identifying structure in the execution trace like identical subgraphs) deep into the middle-end and back-end where it does not belong.
As usual, if a design does not feel right, then it is probably wrong.