You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler is too complicated for people to contribute / fix their bug.
A - Document how stuff works
B - Add compiler tests for key transformations
C - Refactor
D - Profit
How Stuff Works
User generates gamma ast. This is a tree.
Compiler gets tree.
First: flatten-ast . This turns tree into a graph; we call this the 'db'.
Right now all transforms operate on this graphlike 'db'. This causes complexity. ToFix.
Transformation 1: bubble-terms.
This generates information needed for detecting common subexpressions.
For each subexpression in the db, we traverse its parents up the tree. For each parent, we associate the start node to its meta info (:shared )
Specifically, we add it to a hashmap of { start-node times-seen }
Every time a node equivalent to start-node passes though a parent on the way up, we increment this count.
This principle is extended to deal with conditionals. If a node is scoped within an 'if' it will not necessarily evaluate. However we wish to propagate this information. Therefor node counts
[todo more description]
The text was updated successfully, but these errors were encountered:
The compiler is too complicated for people to contribute / fix their bug.
A - Document how stuff works
B - Add compiler tests for key transformations
C - Refactor
D - Profit
How Stuff Works
User generates gamma ast. This is a tree.
Compiler gets tree.
First: flatten-ast . This turns tree into a graph; we call this the 'db'.
Right now all transforms operate on this graphlike 'db'. This causes complexity. ToFix.
Transformation 1: bubble-terms.
This generates information needed for detecting common subexpressions.
For each subexpression in the db, we traverse its parents up the tree. For each parent, we associate the start node to its meta info (:shared )
Specifically, we add it to a hashmap of { start-node times-seen }
Every time a node equivalent to start-node passes though a parent on the way up, we increment this count.
This principle is extended to deal with conditionals. If a node is scoped within an 'if' it will not necessarily evaluate. However we wish to propagate this information. Therefor node counts
[todo more description]
The text was updated successfully, but these errors were encountered: