dillon1000/react
Commit
Browse files Codegen from ReactiveFunction (no memoization yet)
Currently codegen operates from HIR using a tree visitor, but for scope construction we're converting the HIR (CFG) into a ReactiveFunction (AST-like). Our original idea for codegen was that we would convert the ReactiveFunction back to HIR, and then codegen from there. However, the ReactiveFunction is already in tree form...which makes it very straightforward to generate code from. So this PR implements codegen from ReactiveFunction. The output is _identical_ thanks in large part to reusing as much logic from Codegen.ts as possible. The next PR will add memoization logic.
Changed paths4 files
First-parent comparisoncompiler/forget/src/HIR/Codegen.ts ModifiedA compiler/forget/src/HIR/CodegenReactiveFunction.ts AddedM compiler/forget/src/HIR/Pipeline.ts ModifiedM compiler/forget/src/__tests__/hir-test.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…