vrtbl/passerine

Abstract Graph Rewriting and Reduction as the Basis of the Compilation Pipeline

sirinath opened this issue · 1 comments

Can a Graph/Term Rewriting/Reduction system be implemented such that: code -[graph/term rewriting/reduction rules]-> transformed code -[graph/term rewriting/reduction rules]-> AST -[graph/term rewriting/reduction rules]-> AST Lowering -[graph/term rewriting/reduction rules]-> optimised IL/IR -[graph/term rewriting/reduction rules]-> machine code.

I think that just about all transformations in programming can be mapped to a graph transform followed by a reduction. Are you suggesting we extract this into a trait, and have each step of the compiler pipeline implement it? It's not a bad idea, I just need some more clarification. Thanks!